From 088d613e5561e04fcb60723ea05ea2f7ea90f18c Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Fri, 10 Jul 2026 22:53:39 -0700 Subject: [PATCH] Add test coverage for Cursor Agent trust-dialog banner detection Verify lastIndexOf picks the later ready banner over an earlier "Cursor Agent" mention in the trust dialog body, for both the idle-resolution and busy-detection cases. --- src/main/runtime/orca-runtime.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/runtime/orca-runtime.test.ts b/src/main/runtime/orca-runtime.test.ts index c49497d58d3..7a9e927cbfa 100644 --- a/src/main/runtime/orca-runtime.test.ts +++ b/src/main/runtime/orca-runtime.test.ts @@ -10565,6 +10565,9 @@ describe('OrcaRuntimeService', () => { runtime.onPtyData( 'pty-bg', [ + // Trust dialog body can mention "Cursor Agent" before the ready banner; + // lastIndexOf must pick the later banner, not this earlier hit. + 'Cursor Agent\n', '⚠ Workspace Trust Required\n', 'Do you trust the contents of this directory?\n', ' ▶ [a] Trust this workspace\n', @@ -10596,6 +10599,8 @@ describe('OrcaRuntimeService', () => { runtime.onPtyData( 'pty-bg', [ + // Same earlier "Cursor Agent" hit as the idle case — banner must win. + 'Cursor Agent\n', '⚠ Workspace Trust Required\n', 'Do you trust the contents of this directory?\n', ' ▶ [a] Trust this workspace\n',