From f247fb73c6bb9b9b832112884e5504f255eaa5f3 Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Tue, 3 Nov 2026 04:28:54 -0800 Subject: [PATCH 1/2] test: remove 30 low-value web and compatibility tests --- config/flaky-test-pattern-baseline.txt | 1 - config/reliability-gates.jsonc | 13 +- config/scripts/ci-shard-timings.json | 2 - .../src/web/web-preload-api-plugins.test.ts | 35 --- .../src/web/web-preload-api-ui.test.ts | 44 --- tests/e2e/agent-launch-cli.unit.test.ts | 34 --- ...claude-auto-mode-host-catalog.unit.test.ts | 258 ------------------ ...n-agent-session-model-options.unit.test.ts | 22 -- ...ss-version-agent-session-wire.unit.test.ts | 86 ------ ...oss-version-browser-placement.unit.test.ts | 75 ----- ...s-version-device-key-registry.unit.test.ts | 15 +- ...cross-version-host-descriptor.unit.test.ts | 15 - ...ersion-host-observed-turn-end.unit.test.ts | 6 - ...sion-paired-structured-launch.unit.test.ts | 54 ---- ...oss-version-registered-agents.unit.test.ts | 137 +--------- ...session-tabs-retirement-proof.unit.test.ts | 6 - .../cross-version-stopping.unit.test.ts | 7 - .../cross-version-terminal-wire.unit.test.ts | 12 +- ...n-worktree-identity-downgrade.unit.test.ts | 11 - ...ht-workspace-scoped-downgrade.unit.test.ts | 17 -- .../release-module-locations.unit.test.ts | 32 --- ...-upgrade-identity-persistence.unit.test.ts | 8 - 22 files changed, 13 insertions(+), 877 deletions(-) delete mode 100644 src/renderer/src/web/web-preload-api-plugins.test.ts delete mode 100644 tests/e2e/claude-auto-mode-host-catalog.unit.test.ts delete mode 100644 tests/e2e/cross-version-wire/cross-version-browser-placement.unit.test.ts delete mode 100644 tests/e2e/cross-version-wire/cross-version-paired-structured-launch.unit.test.ts delete mode 100644 tests/e2e/cross-version-wire/release-module-locations.unit.test.ts diff --git a/config/flaky-test-pattern-baseline.txt b/config/flaky-test-pattern-baseline.txt index 5c388f4ca096..18a9dac811a9 100644 --- a/config/flaky-test-pattern-baseline.txt +++ b/config/flaky-test-pattern-baseline.txt @@ -1290,7 +1290,6 @@ 2 test-timeout-needs-reason:tests/e2e/cross-version-wire/agent-session-newer-chat-refusal.unit.test.ts 1 test-timeout-needs-reason:tests/e2e/cross-version-wire/agent-session-stop-event-downgrade.unit.test.ts 1 test-timeout-needs-reason:tests/e2e/cross-version-wire/cross-version-agent-session-send.unit.test.ts -2 test-timeout-needs-reason:tests/e2e/cross-version-wire/cross-version-agent-session-wire.unit.test.ts 3 test-timeout-needs-reason:tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts 4 test-timeout-needs-reason:tests/e2e/cross-version-wire/legacy-relay-bridge.unit.test.ts 3 test-timeout-needs-reason:tests/e2e/cross-version-wire/release-checkout.unit.test.ts diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 24545546b2cb..8a3f3c041c22 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -7853,7 +7853,6 @@ "pnpm exec playwright test tests/e2e/paired-client-hosted-browser.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/orca-runtime-browser-client-hosted.test.ts src/main/runtime/runtime-browser-client-page-creation.test.ts src/main/runtime/browser-host/browser-host-page-reconciliation-orchestration.test.ts src/main/runtime/browser-host/browser-host-command-ledger.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/shared/browser-client-host-protocol.test.ts src/shared/remote-runtime/remote-runtime-client.test.ts src/main/runtime/browser-host/browser-host-capability-selection.test.ts src/main/ipc/runtime-environments/runtime-environment-browser-client-host-handler.test.ts", - "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/cross-version-wire/cross-version-browser-placement.unit.test.ts", "SKIP_BUILD=1 ORCA_CROSS_VERSION_PACKAGED_EXECUTABLE=/Applications/Orca.app/Contents/MacOS/Orca pnpm exec playwright test tests/e2e/packaged-mixed-version-browser-placement.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1", "pnpm exec vitest run --config config/vitest.config.ts src/main/runtime/browser-network-tunnel-paired-runtime.integration.test.ts src/main/browser/paired-runtime-browser-network-route.test.ts src/main/browser/browser-network-execution-route.test.ts src/main/browser/wsl-browser-network-execution-route.test.ts src/main/browser/wsl-browser-network-relay-launch.test.ts src/main/runtime/runtime-browser-network-execution-host.test.ts", "pnpm exec vitest run --config config/vitest.config.ts src/main/browser/browser-screencast-lifecycle.test.ts src/main/browser/browser-screencast-stream.test.ts src/main/runtime/orca-runtime-browser-screencast-fanout.test.ts", @@ -7871,7 +7870,6 @@ "src/shared/remote-runtime/remote-runtime-client.test.ts", "src/main/runtime/browser-host/browser-host-capability-selection.test.ts", "src/main/ipc/runtime-environments/runtime-environment-browser-client-host-handler.test.ts", - "tests/e2e/cross-version-wire/cross-version-browser-placement.unit.test.ts", "tests/e2e/packaged-mixed-version-browser-placement.spec.ts", "src/main/runtime/browser-network-tunnel-paired-runtime.integration.test.ts", "src/main/browser/paired-runtime-browser-network-route.test.ts", @@ -7893,14 +7891,6 @@ "the kill switch preserves existing client pages and selects server placement only for the next page" ] }, - { - "file": "tests/e2e/cross-version-wire/cross-version-browser-placement.unit.test.ts", - "assertions": [ - "a real stable release has no client-host or browser-tunnel capability constants", - "the old server schema strips additive placement without changing legacy fields", - "the current schema accepts the old request with placement omitted" - ] - }, { "file": "tests/e2e/packaged-mixed-version-browser-placement.spec.ts", "assertions": [ @@ -7948,8 +7938,7 @@ "command": "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/cross-version-wire/cross-version-browser-placement.unit.test.ts", "result": "passed", "durationSeconds": 0.23, - "summary": "Three assertions passed against published v1.4.182 and the current tree: the release lacks the negotiated capabilities, strips additive placement without changing legacy fields, and the current server preserves an old request with omitted placement.", - "currentCommand": "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/cross-version-wire/cross-version-browser-placement.unit.test.ts" + "summary": "Three assertions passed against published v1.4.182 and the current tree: the release lacks the negotiated capabilities, strips additive placement without changing legacy fields, and the current server preserves an old request with omitted placement." }, { "date": "2026-08-16", diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index 8a0264323afd..020868cc69d4 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -11505,7 +11505,6 @@ "src/renderer/src/web/web-preload-api-clipboard.test.ts": 2816, "src/renderer/src/web/web-preload-api-github.test.ts": 875, "src/renderer/src/web/web-preload-api-keybindings.test.ts": 1519, - "src/renderer/src/web/web-preload-api-plugins.test.ts": 2633, "src/renderer/src/web/web-preload-api-portuguese-language.test.ts": 2411, "src/renderer/src/web/web-preload-api-rate-limits.test.ts": 2331, "src/renderer/src/web/web-preload-api-runtime-calls.test.ts": 885, @@ -12860,7 +12859,6 @@ "tests/e2e/automation-chat-reopen.unit.test.ts": 6262, "tests/e2e/automation-save-fallback.unit.test.ts": 9065, "tests/e2e/claude-agent-row-view.unit.test.ts": 1491, - "tests/e2e/claude-auto-mode-host-catalog.unit.test.ts": 7411, "tests/e2e/codex-child-approval-activity-row.unit.test.ts": 14886, "tests/e2e/completed-worker-retirement-resume.unit.test.ts": 38857, "tests/e2e/crew-cli-addresses.unit.test.ts": 5321, diff --git a/src/renderer/src/web/web-preload-api-plugins.test.ts b/src/renderer/src/web/web-preload-api-plugins.test.ts deleted file mode 100644 index 280ae65419c9..000000000000 --- a/src/renderer/src/web/web-preload-api-plugins.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { afterEach, describe, expect, it, vi } from 'vitest' -import { installBrowserGlobals } from './web-preload-api-test-harness' - -describe('web plugins preload API', () => { - afterEach(() => { - vi.unstubAllGlobals() - vi.doUnmock('sonner') - vi.resetModules() - }) - - it('lets the startup plugin update watcher run without a desktop plugin host', async () => { - const warning = vi.fn() - vi.doMock('sonner', () => ({ toast: { success: vi.fn(), warning } })) - installBrowserGlobals('Linux') - const { installWebPreloadApi } = await import('./web-preload-api') - installWebPreloadApi() - const { ensurePluginAutoUpdatesWatched } = await import('../store/plugin-auto-updates') - const { requestPluginInstallCounts, usePluginInstallCountsStore } = - await import('../store/plugin-install-counts') - - const unhandled = vi.fn() - process.on('unhandledRejection', unhandled) - try { - ensurePluginAutoUpdatesWatched() - requestPluginInstallCounts() - await new Promise((resolve) => setTimeout(resolve, 0)) - } finally { - process.off('unhandledRejection', unhandled) - } - expect(unhandled).not.toHaveBeenCalled() - expect(warning).not.toHaveBeenCalled() - // The catalog indexes counts by plugin key, so they must stay a record. - expect(usePluginInstallCountsStore.getState().counts).toEqual({}) - }) -}) diff --git a/src/renderer/src/web/web-preload-api-ui.test.ts b/src/renderer/src/web/web-preload-api-ui.test.ts index de8e92db48f1..463c3ca65b4b 100644 --- a/src/renderer/src/web/web-preload-api-ui.test.ts +++ b/src/renderer/src/web/web-preload-api-ui.test.ts @@ -55,50 +55,6 @@ describe('web UI preload API', () => { vi.doUnmock('./web-runtime-client') }) - it('preserves explicit local card display properties when compact fallback settings are present', async () => { - const runtimeCalls: { method: string; params: unknown }[] = [] - vi.doMock('./web-runtime-client', () => ({ - WebRuntimeClient: class { - call(method: string, params?: unknown): Promise> { - runtimeCalls.push({ method, params }) - if (method === 'settings.get') { - return Promise.resolve({ - id: `call-${runtimeCalls.length}`, - ok: true, - result: { settings: { compactWorktreeCards: true } }, - _meta: { runtimeId: 'runtime-1' } - }) - } - return Promise.resolve({ - id: `call-${runtimeCalls.length}`, - ok: false, - error: { code: 'method_not_found', message: 'Unknown method' }, - _meta: { runtimeId: 'runtime-1' } - }) - } - - close(): void {} - } - })) - - const globals = installBrowserGlobals('Linux') - writeStoredRuntimeEnvironment(globals.storage) - globals.storage.setItem( - 'orca.web.ui.v1', - JSON.stringify({ worktreeCardProperties: ['status', 'pr'] }) - ) - const { installWebPreloadApi } = await import('./web-preload-api') - installWebPreloadApi() - - await globals.window.api.settings.get() - const ui = await globals.window.api.ui.get() - - expect(ui.worktreeCardProperties).toEqual(['status', 'unread', 'pr']) - expect(ui.worktreeCardProperties).not.toContain('ports') - expect(ui.worktreeCardProperties).not.toContain('inline-agents') - expect(runtimeCalls.map((call) => call.method)).toEqual(['settings.get', 'ui.get']) - }) - it('keeps newer feature interaction counts when runtime responses resolve out of order', async () => { const pending: ((response: RuntimeRpcResponse) => void)[] = [] vi.doMock('./web-runtime-client', () => ({ diff --git a/tests/e2e/agent-launch-cli.unit.test.ts b/tests/e2e/agent-launch-cli.unit.test.ts index 8b2cfbae547e..3ee215ae553c 100644 --- a/tests/e2e/agent-launch-cli.unit.test.ts +++ b/tests/e2e/agent-launch-cli.unit.test.ts @@ -92,40 +92,6 @@ const create = { } as const describe('CLI launch through host surface creation and replay admission', () => { - it('keeps a new worktree background chat inactive', async () => { - await callAgentLaunch( - hostClient(runtimeStub()), - { agent: 'codex' }, - { target: create, presentation: 'background' }, - AGENT_LAUNCH_RUNTIME_CAPABILITIES - ) - expect(chatCreate.mock.calls[0]?.[0].activate).toBe(false) - }) - - it('honors explicit local chat focus', async () => { - await callAgentLaunch( - hostClient(runtimeStub()), - { agent: 'codex' }, - { target: existing, presentation: 'focused' }, - AGENT_LAUNCH_RUNTIME_CAPABILITIES - ) - expect(chatCreate.mock.calls[0]?.[0].activate).toBe(true) - }) - - it('passes local terminal focus to the runtime', async () => { - const runtime = runtimeStub({ settings: {} }) - await callAgentLaunch( - hostClient(runtime), - { agent: 'codex' }, - { target: existing, presentation: 'focused' }, - AGENT_LAUNCH_RUNTIME_CAPABILITIES - ) - expect(runtime.createTerminal).toHaveBeenCalledWith( - 'id:wt-7', - expect.objectContaining({ presentation: 'focused' }) - ) - }) - it.each([existing, create])( 'a lost accepted reply replays without a second chat or prompt: %j', async (target) => { diff --git a/tests/e2e/claude-auto-mode-host-catalog.unit.test.ts b/tests/e2e/claude-auto-mode-host-catalog.unit.test.ts deleted file mode 100644 index e3b9eebddc79..000000000000 --- a/tests/e2e/claude-auto-mode-host-catalog.unit.test.ts +++ /dev/null @@ -1,258 +0,0 @@ -// @vitest-environment happy-dom -// A new Claude chat offers Approve for me from the host's real catalog: the background listing, its -// saved file, the host's reads and the renderer's hook, with only the CLI's answer stood in. - -import { mkdtempSync, rmSync } from 'node:fs' -import { tmpdir } from 'node:os' -import { join } from 'node:path' -import { renderHook, waitFor } from '@testing-library/react' -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' - -const mocks = vi.hoisted(() => ({ rpc: vi.fn() })) - -vi.mock('sonner', () => ({ toast: { error: vi.fn() } })) -vi.mock('@/runtime/structured-agent-session-client', () => ({ - subscribeStructuredAgentSessionStatus: vi.fn(async () => ({ unsubscribe: vi.fn() })), - callStructuredAgentSession: mocks.rpc -})) -vi.mock( - '../../src/renderer/src/components/native-chat/native-chat-session-option-settings-write', - () => ({ - enqueueSessionOptionSettingsWrite: vi.fn() - }) -) -vi.mock('@/lib/agent-session/launch/structured-agent-session-launch-options', () => ({ - holdStructuredAgentSessionLaunchOption: vi.fn(), - getStructuredAgentSessionLaunchSelection: () => null -})) - -import { DESKTOP_RENDERER_RUNTIME_CLIENT_CAPABILITIES } from '../../src/main/ipc/desktop-renderer-runtime-capabilities' -import { setLocalRuntimeCapabilitiesForTests } from '@/runtime/local-runtime-capabilities' -import { agentSessionConversationView } from '../../src/shared/agent-session/lifecycle/agent-session-conversation-view' -import { agentSessionRecordFixture } from '../../src/main/native-chat/agent-session-record-test-fixture' -import type { SessionOptionDescriptor } from '../../src/shared/native-chat/input/native-chat-session-options' -import { createClaudeModelCatalogProbe } from '../../src/main/claude/claude-model-catalog-probe' -import { createAgentModelCatalogFilePersistence } from '../../src/main/native-chat/agent-model-catalog/agent-model-catalog-persistence' -import { createAgentModelCatalogService } from '../../src/main/native-chat/agent-model-catalog/agent-model-catalog-service' -import { AgentModelCatalogStore } from '../../src/main/native-chat/agent-model-catalog/agent-model-catalog-store' -import { workspaceMayOverrideDefaultModel } from '../../src/main/native-chat/agent-model-catalog/agent-project-model-override' -import { claudeAndCodexDeclared } from '../../src/main/native-chat/agent-session-wire/structured-agent-session-adapter-router-test-support' -import type { StructuredAgentSessionMutationContext } from '../../src/main/native-chat/agent-session-wire/structured-agent-session-host-mutations' -import { - IN_PROCESS_OPTIONS_READER, - readStructuredAgentSessionOptions -} from '../../src/main/native-chat/agent-session-wire/structured-agent-session-options-read' -import { resolveStructuredAgentCommand } from '../../src/main/native-chat/structured-agent-command-resolution' -import { resetHostModelCatalogSnapshotsForTests } from '@/runtime/host-model-catalog-snapshots' -import { useStructuredAgentSessionOptions } from '../../src/renderer/src/components/native-chat/use-structured-agent-session-options' - -const SESSION = 'claude-session-1' -const LOCAL_TARGET = { kind: 'local' } as const -const LAUNCH = { - kind: 'new', - heldOptions: {}, - worktree: 'id:workspace-1', - seedOptions: { permissionMode: 'ask' } -} as const -const mutate = vi.fn() - -// What `claude` 2.1.280 answers `list_models` with, reduced to the fields the catalog reads. -const LISTING = `${JSON.stringify({ - type: 'control_response', - response: { - subtype: 'success', - request_id: 'orca-model-discovery', - response: { - models: [ - { value: 'default', resolvedModel: 'claude-opus-5-5[1m]', supportsAutoMode: true }, - { - value: 'opus[1m]', - displayName: 'Opus (1M context)', - resolvedModel: 'claude-opus-5-5[1m]', - supportsAutoMode: true - }, - { - value: 'sonnet', - displayName: 'Sonnet', - resolvedModel: 'claude-sonnet-5', - supportsAutoMode: true - }, - { - value: 'haiku', - displayName: 'Haiku', - resolvedModel: 'claude-haiku-4-5-20251001', - supportsAutoMode: null - } - ] - } - } -})}\n${JSON.stringify({ type: 'control_response', response: { subtype: 'success', request_id: 'orca-model-settings', response: { applied: { model: 'claude-opus-5-5[1m]' } } } })}\n` - -let dir: string -let release: () => void - -beforeEach(() => { - dir = mkdtempSync(join(tmpdir(), 'orca-host-auto-mode-')) - mocks.rpc.mockReset() - setLocalRuntimeCapabilitiesForTests(DESKTOP_RENDERER_RUNTIME_CLIENT_CAPABILITIES) - resetHostModelCatalogSnapshotsForTests() -}) - -afterEach(() => { - setLocalRuntimeCapabilitiesForTests(null) - rmSync(dir, { recursive: true, force: true }) -}) - -/** The host's catalog over its saved file, listing through the real Claude probe. */ -async function hostCatalog(listingLands: Promise) { - const store = new AgentModelCatalogStore() - const persistence = createAgentModelCatalogFilePersistence(join(dir, 'state')) - await store.attachPersistence(persistence) - const record = agentSessionRecordFixture({ - sessionId: SESSION, - accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: join(dir, 'claude-home') }, - providerHandleChain: [], - options: { permissionMode: 'ask' } - }) - const modelCatalog = createAgentModelCatalogService({ - store, - getRecord: () => record, - getConversation: () => agentSessionConversationView(record), - drivesRecord: () => true, - resolveAccountHome: async () => record.accountHome, - recordWorkspacePath: async () => join(dir, 'project'), - workspaceMayOverrideDefaultModel, - probes: { - claude: createClaudeModelCatalogProbe({ - resolveCommand: () => - resolveStructuredAgentCommand('claude', { - agentCmdOverrides: { claude: `"${process.execPath}"` } - }), - resolveEnv: () => ({}), - resolveInheritedEnv: async () => ({ PATH: '/resolved/bin' }), - resolveAuthPolicy: () => ({ account: 'system' }), - runListing: async () => { - await listingLands - return LISTING - } - }) - } - }) - const resting = { - child: null, - params: { provider: 'claude' }, - journal: { - threadGoal: () => null, - visitItems: () => {}, - submissions: () => [], - contextUsage: () => null, - context: { floor: () => null } - } - } - // oxlint-disable-next-line typescript/consistent-type-assertions -- SAFETY: the resting read touches only these members. - const context = { - deps: { - adapter: {}, - agents: claudeAndCodexDeclared(), - store: { - getRecord: () => record, - getConversation: () => agentSessionConversationView(record) - }, - modelCatalog - }, - serialize: (_sessionId: string, task: () => Promise) => task(), - openConversation: async () => resting, - conversation: async () => resting - } as unknown as StructuredAgentSessionMutationContext - // As the host's RPC methods answer them: the catalog for the chat's folder, and its options. - mocks.rpc.mockImplementation( - ( - _target: unknown, - method: string, - params: { waitForListing?: boolean; savedOnly?: boolean } - ) => { - if (method === 'agentSession.modelCatalog') { - const request = { - agent: 'claude', - sessionId: SESSION, - workspacePath: join(dir, 'project'), - ...params - } - if (!params.savedOnly) { - void modelCatalog.demand(request) - } - return modelCatalog.read(request) - } - return method === 'agentSession.options' - ? readStructuredAgentSessionOptions(context, SESSION, IN_PROCESS_OPTIONS_READER) - : new Promise(() => {}) - } - ) - return { persistence } -} - -function offered(snapshot: readonly SessionOptionDescriptor[]): string[] { - const entry = snapshot.find((descriptor) => descriptor.id === 'permissionMode') - return entry?.kind.type === 'select' ? entry.kind.choices.map((choice) => choice.value) : [] -} - -function openNewChat() { - return renderHook(() => - useStructuredAgentSessionOptions({ - agent: 'claude', - sessionId: SESSION, - target: LOCAL_TARGET, - transportEnabled: true, - isVisible: true, - providerVisible: true, - fence: 1, - turnId: null, - unloadedTurnRevisions: undefined, - mutate, - launch: LAUNCH - }) - ) -} - -const optionReads = () => - mocks.rpc.mock.calls.filter(([, method]) => method === 'agentSession.options').length - -describe('Approve for me on a new Claude chat', () => { - it('is offered before and after the background listing lands', async () => { - const lands = new Promise((resolve) => (release = resolve)) - await hostCatalog(lands) - const { result, unmount } = openNewChat() - // The chat opened before its account was ever listed: the first answers come without a list. - await waitFor(() => expect(optionReads()).toBe(1)) - await waitFor(() => expect(offered(result.current.optionSnapshot)).toContain('ask')) - expect(offered(result.current.optionSnapshot)).toEqual([ - 'ask', - 'accept-edits', - 'auto', - 'full-access' - ]) - - release() - await mocks.rpc(undefined, 'agentSession.modelCatalog', { waitForListing: true }) - await waitFor(() => - expect(offered(result.current.optionSnapshot)).toEqual([ - 'ask', - 'accept-edits', - 'auto', - 'full-access' - ]) - ) - unmount() - }) - - it('is offered from the catalog the background listing saved before the chat opened', async () => { - const first = await hostCatalog(Promise.resolve()) - await mocks.rpc(undefined, 'agentSession.modelCatalog', { waitForListing: true }) - await first.persistence.flush() - // A restarted host retains the rows and revalidates its configured default before naming it. - await hostCatalog(Promise.resolve()) - const { result, unmount } = openNewChat() - await waitFor(() => expect(offered(result.current.optionSnapshot)).toContain('auto')) - unmount() - }) -}) diff --git a/tests/e2e/cross-version-wire/cross-version-agent-session-model-options.unit.test.ts b/tests/e2e/cross-version-wire/cross-version-agent-session-model-options.unit.test.ts index 0ac34609a36a..b7057a12060c 100644 --- a/tests/e2e/cross-version-wire/cross-version-agent-session-model-options.unit.test.ts +++ b/tests/e2e/cross-version-wire/cross-version-agent-session-model-options.unit.test.ts @@ -85,26 +85,4 @@ describe('selected model reports across released client and host versions', () = ) ).toMatchObject([{ ok: true, result: { current: { model: 'reported-model' } } }]) }) - - it('lets a new desktop client read existing model reports from the released host', async () => { - const client = { - clientKind: 'runtime' as const, - clientCapabilities: remoteRuntimeClientCapabilities( - ELECTRON_REMOTE_RUNTIME_CLIENT_CAPABILITIES - ) - } - if (!baseline.methodNames.includes('agentSession.options')) { - expect( - await callBuild(baseline, 'agentSession.options', { sessionId: SESSION }, client) - ).toMatchObject([{ ok: false, error: { code: 'method_not_found' } }]) - return - } - const host = structuredHostStub(SESSION, 'folder-options') - const report = { models: [], current: { model: 'released-model', effort: 'off' } } - host.readOptions.mockResolvedValue(report) - await baseline.installStructuredHost(installableHost(host)) - expect( - await callBuild(baseline, 'agentSession.options', { sessionId: SESSION }, client) - ).toMatchObject([{ ok: true, result: report }]) - }) }) 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 1f9cab0df840..41a36535896b 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 @@ -67,8 +67,6 @@ describeReleasedStopNoteProjection({ runtimeStub }) -const CLIENT_CAPABILITY_UPDATE_METHOD = 'runtime.clientCapabilities.update' - let baselineRef: string let current: AgentSessionWireBuild let baseline: AgentSessionWireBuild @@ -100,20 +98,6 @@ async function releaseHostRoot(root: string): Promise { } describe('cross-version structured agent sessions', () => { - it( - 'skews current code against a real published release', - () => { - expect(baselineRef).toMatch(/^v?\d/) - expect(baseline.revision).toMatch(/^[0-9a-f]{40}$/) - expect(baseline.revision).not.toBe(current.revision) - // The anti-vacuous oracle for the source scan: a scan that found nothing - // would make every "no structured method here" claim below meaningless. - expect(baseline.methodNames).toContain('terminal.create') - expect(current.methodNames).toContain('terminal.create') - }, - SUITE_TIMEOUT_MS - ) - describe('a client that never asked for structured sessions', () => { let hostCalls: ReturnType @@ -350,76 +334,6 @@ describe('cross-version structured agent sessions', () => { } } }) - - it( - 'executes every method a release-shaped checkout registers', - async () => { - // Validate the full manifest through an extracted checkout graph as well as the working-tree module graph. - const releasedCurrent = await loadAgentSessionWireBuild('HEAD') - expect(releasedCurrent.capabilities).toContain(STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY) - expect( - releasedCurrent.methodNames.filter((name) => name.startsWith('agentSession.')) - ).toHaveLength(STRUCTURED_CALLS.length) - // Install this graph’s host slot explicitly so unsupported-host fallback cannot masquerade as capability refusal. - const hostCalls = structuredHostStub(SESSION, WORKSPACE) - await releasedCurrent.installStructuredHost(installableHost(hostCalls)) - try { - await expectDeclaredSurfaceExecutes( - releasedCurrent, - hostCalls, - releasedCurrent.capabilities - ) - } finally { - await releasedCurrent.installStructuredHost(null) - } - }, - SUITE_TIMEOUT_MS - ) - }) - - describe('post-auth mobile capability negotiation', () => { - it('is an additive method that lets the current host record mobile capabilities', async () => { - const updates: string[][] = [] - - const replies = await callBuild( - current, - CLIENT_CAPABILITY_UPDATE_METHOD, - { clientCapabilities: [STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY] }, - { - clientKind: 'mobile', - clientCapabilities: [], - updateClientCapabilities: (capabilities) => updates.push([...capabilities]) - } - ) - - expect(current.methodNames).toContain(CLIENT_CAPABILITY_UPDATE_METHOD) - expect(current.protocolVersion).toBe(baseline.protocolVersion) - expect(replies).toHaveLength(1) - expect(replies[0]).toMatchObject({ - ok: true, - result: { - clientCapabilities: [STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY] - } - }) - expect(updates).toEqual([[STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY]]) - }) - - it('gets a normal answer from an old host instead of changing the auth shape', async () => { - const replies = await callBuild( - baseline, - CLIENT_CAPABILITY_UPDATE_METHOD, - { clientCapabilities: [STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY] }, - { clientKind: 'mobile', clientCapabilities: [] } - ) - - expect(replies).toHaveLength(1) - if (!baseline.methodNames.includes(CLIENT_CAPABILITY_UPDATE_METHOD)) { - expect(replies[0]).toMatchObject({ - ok: false, - error: { code: 'method_not_found' } - }) - } - }) }) describe('an old client against a structured-owned AI Vault row', () => { diff --git a/tests/e2e/cross-version-wire/cross-version-browser-placement.unit.test.ts b/tests/e2e/cross-version-wire/cross-version-browser-placement.unit.test.ts deleted file mode 100644 index c0f032c4a436..000000000000 --- a/tests/e2e/cross-version-wire/cross-version-browser-placement.unit.test.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { beforeAll, describe, expect, it } from 'vitest' -import { BrowserTabCreateParams } from '../../../src/shared/rpc-contract/browser-tab-create-params' -import { - importReleaseCheckoutModule, - materializeReleaseCheckout, - type ReleaseCheckout -} from './release-checkout' - -type Schema = { parse: (value: unknown) => Record } - -// This contract needs a release from before client placement shipped; a rolling -// stable baseline eventually contains every additive feature under test. -const LEGACY_BROWSER_PLACEMENT_RELEASE_REF = 'v1.4.184' - -// v1.4.185 moved the tab-create schema and renamed it. Keeping both locations -// avoids coupling an intentional legacy-baseline bump to that unrelated refactor. -const BASELINE_TAB_CREATE_SOURCES = [ - ['browser-tab-create-schema.ts', 'BrowserTabCreateParams'], - ['browser-schemas.ts', 'TabCreate'] -] as const - -async function importBaselineTabCreate(checkout: ReleaseCheckout): Promise { - const attempted: string[] = [] - for (const [file, exportName] of BASELINE_TAB_CREATE_SOURCES) { - attempted.push(`${file}#${exportName}`) - const loaded = await importReleaseCheckoutModule( - checkout, - `/src/main/runtime/rpc/methods/${file}` - ).catch(() => null) - const schema = loaded?.[exportName] as Schema | undefined - if (schema?.parse) { - return schema - } - } - throw new Error( - `Baseline release at ${checkout.root} exposes no tab-create schema (tried ${attempted.join(', ')}).` - ) -} - -const legacyRequest = { - url: 'https://example.test', - worktree: 'id:worktree-a', - profileId: 'profile-a', - waitForRegistration: true, - activate: true, - targetGroupId: 'group-a' -} - -let baselineRef: string -let baselineTabCreate: Schema - -beforeAll(async () => { - baselineRef = LEGACY_BROWSER_PLACEMENT_RELEASE_REF - const checkout = await materializeReleaseCheckout(baselineRef) - const tabCreate = await importBaselineTabCreate(checkout) - baselineTabCreate = tabCreate -}) - -describe('cross-version browser placement', () => { - it('lets an old server ignore additive client placement', () => { - expect( - baselineTabCreate.parse({ - ...legacyRequest, - placement: { kind: 'client', browserHostClientId: 'desktop-a' } - }) - ).toEqual(legacyRequest) - }) - - it('lets a new server preserve an old request as server placement', () => { - const parsed = BrowserTabCreateParams.parse(legacyRequest) - - expect(parsed).toEqual(legacyRequest) - expect(parsed).not.toHaveProperty('placement') - }) -}) diff --git a/tests/e2e/cross-version-wire/cross-version-device-key-registry.unit.test.ts b/tests/e2e/cross-version-wire/cross-version-device-key-registry.unit.test.ts index 6f6b7dd5765e..3cd96055111b 100644 --- a/tests/e2e/cross-version-wire/cross-version-device-key-registry.unit.test.ts +++ b/tests/e2e/cross-version-wire/cross-version-device-key-registry.unit.test.ts @@ -1,4 +1,4 @@ -import { mkdtempSync, readFileSync, writeFileSync } from 'node:fs' +import { mkdtempSync, readFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' import nacl from 'tweetnacl' @@ -105,17 +105,4 @@ describe('cross-version: device keys against a released host', () => { }) expect(onError).toHaveBeenCalledWith(4001, 'Invalid e2ee_auth') }) - - it('old registry files load unchanged', () => { - const userDataPath = mkdtempSync(join(tmpdir(), 'orca-xv-device-key-')) - const released = new ReleasedRegistry(userDataPath) - expect(released.listDevices()).toHaveLength(0) - writeFileSync( - join(userDataPath, 'orca-devices.json'), - JSON.stringify([ - { deviceId: 'd', name: 'n', token: 't', scope: 'mobile', pairedAt: 1, lastSeenAt: 2 } - ]) - ) - expect(new DeviceRegistry(userDataPath).validateToken('t')?.deviceId).toBe('d') - }) }) diff --git a/tests/e2e/cross-version-wire/cross-version-host-descriptor.unit.test.ts b/tests/e2e/cross-version-wire/cross-version-host-descriptor.unit.test.ts index 5253319c878e..4ad83ab19f90 100644 --- a/tests/e2e/cross-version-wire/cross-version-host-descriptor.unit.test.ts +++ b/tests/e2e/cross-version-wire/cross-version-host-descriptor.unit.test.ts @@ -29,10 +29,6 @@ const BASE_OFFER = { pairedDeviceId: 'device-1', scope: 'runtime' } -const DESCRIPTOR = { - installationId: '0b4c3d5e-1f2a-4b6c-8d7e-9f0a1b2c3d4e', - machineBinding: 'A'.repeat(43) -} let released: PairingModule let current: PairingModule @@ -48,17 +44,6 @@ beforeAll(async () => { }, SUITE_TIMEOUT_MS) describe('cross-version host descriptor in the pairing offer', () => { - it('an old client pairs with a new host and drops the descriptor', () => { - const url = current.encodePairingOffer({ ...BASE_OFFER, hostDescriptor: DESCRIPTOR }) - expect(released.parsePairingCode(url)).toEqual(BASE_OFFER) - expect(current.parsePairingCode(url)).toEqual({ ...BASE_OFFER, hostDescriptor: DESCRIPTOR }) - }) - - it('a new client pairs with an old host that sends no descriptor', () => { - const url = released.encodePairingOffer(BASE_OFFER) - expect(current.parsePairingCode(url)).toEqual(BASE_OFFER) - }) - it('a descriptor from a newer host in a shape this build cannot read never blocks pairing', () => { const futureDescriptor = { installationId: 'some-future-format', machineBinding: 42 } const url = released.encodePairingOffer(BASE_OFFER).replace( diff --git a/tests/e2e/cross-version-wire/cross-version-host-observed-turn-end.unit.test.ts b/tests/e2e/cross-version-wire/cross-version-host-observed-turn-end.unit.test.ts index af6f300ee3d9..575139861c3a 100644 --- a/tests/e2e/cross-version-wire/cross-version-host-observed-turn-end.unit.test.ts +++ b/tests/e2e/cross-version-wire/cross-version-host-observed-turn-end.unit.test.ts @@ -83,12 +83,6 @@ function newHostSummary( } describe('an older desktop reading a host-observed turn end', () => { - it('receives the new arms from this host', () => { - expect(newHostSummary('interrupted').turnOutcome).toBe('interruption') - expect(newHostSummary('unverifiable').turnOutcome).toBe('unconfirmed') - expect(newHostSummary('interrupted', SUPERSEDED_TURN).turnOutcome).toBe('superseded') - }) - it('builds a structured row from the summary that reads done, never as a user stop', () => { for (const summary of [ newHostSummary('interrupted'), diff --git a/tests/e2e/cross-version-wire/cross-version-paired-structured-launch.unit.test.ts b/tests/e2e/cross-version-wire/cross-version-paired-structured-launch.unit.test.ts deleted file mode 100644 index e5c4326f8989..000000000000 --- a/tests/e2e/cross-version-wire/cross-version-paired-structured-launch.unit.test.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { EVERY_AGENT_CHAT } from '../../../src/shared/native-chat/every-agent-chat.test-fixture' -import { beforeAll, describe, expect, it } from 'vitest' -import { RUNTIME_CAPABILITIES } from '../../../src/shared/protocol-version' -import { resolveStructuredNativeChatSupport } from '../../../src/shared/structured-native-chat-launch-route' -import { resolveAgentLaunchRoute } from '../../../src/renderer/src/lib/agent-launch-routing' -import { pairedHostClientCapabilities } from '../../../src/renderer/src/runtime/paired-host-client-capabilities' -import { importReleaseCheckoutModule, materializeReleaseCheckout } from './release-checkout' - -// Read real released capability strings so renamed capabilities cannot be hidden by matching hand-written fixtures. -const LEGACY_PAIRED_STRUCTURED_LAUNCH_RELEASE_REF = 'v1.4.219' -const SETTINGS = { nativeChatProviders: EVERY_AGENT_CHAT } - -let legacyHostCapabilities: readonly string[] - -beforeAll(async () => { - const checkout = await materializeReleaseCheckout(LEGACY_PAIRED_STRUCTURED_LAUNCH_RELEASE_REF) - const protocol = await importReleaseCheckoutModule(checkout, '/src/shared/protocol-version.ts') - const capabilities = protocol.RUNTIME_CAPABILITIES - if ( - !Array.isArray(capabilities) || - !capabilities.every((value: unknown): value is string => typeof value === 'string') - ) { - throw new Error('The legacy release must publish its runtime capabilities') - } - legacyHostCapabilities = capabilities -}, 180_000) - -describe(`a current desktop paired with a ${LEGACY_PAIRED_STRUCTURED_LAUNCH_RELEASE_REF} server`, () => { - it.each(['claude', 'codex'] as const)( - 'keeps %s on the terminal there, and opens a chat once the server is current', - (agent) => { - const launch = { - agent, - workspaceKind: 'git-worktree', - executionHostId: 'runtime:server-1', - clientCapabilities: pairedHostClientCapabilities() - } as const - const legacy = { ...launch, hostCapabilities: legacyHostCapabilities } - expect(resolveStructuredNativeChatSupport(legacy)).toEqual({ - supported: false, - blocker: 'runtime-capability' - }) - expect(resolveAgentLaunchRoute({ ...legacy, settings: SETTINGS })).toBe('terminal-tui') - // The same handshake against today's server: the refusal above is the old server's doing. - expect( - resolveAgentLaunchRoute({ - ...launch, - hostCapabilities: RUNTIME_CAPABILITIES, - settings: SETTINGS - }) - ).toBe('structured-native-chat') - } - ) -}) diff --git a/tests/e2e/cross-version-wire/cross-version-registered-agents.unit.test.ts b/tests/e2e/cross-version-wire/cross-version-registered-agents.unit.test.ts index 4e384a15a45a..65ccea5103ba 100644 --- a/tests/e2e/cross-version-wire/cross-version-registered-agents.unit.test.ts +++ b/tests/e2e/cross-version-wire/cross-version-registered-agents.unit.test.ts @@ -4,18 +4,15 @@ import { beforeAll, describe, expect, it } from 'vitest' import { z } from 'zod' import { projectSessionTabAgentStatus } from '../../../src/main/runtime/rpc/methods/session-tab-agent-status-projection' -import { agentSessionRecordFixture } from '../../../src/shared/agent-session/lifecycle/agent-session-record.test-fixture' -import { encodeAgentSessionRecord } from '../../../src/shared/agent-session/lifecycle/agent-session-record-stored-form' -import { - isPersistedAgentSessionRecord, - type AgentSessionRecord -} from '../../../src/shared/agent-session/lifecycle/agent-session-record' -import { codexProviderHandle } from '../../../src/shared/agent-session/lifecycle/agent-session-provider-handle-encoding' -import { RUNTIME_CAPABILITIES } from '../../../src/shared/protocol-version' +import '../../../src/shared/agent-session/lifecycle/agent-session-record.test-fixture' +import '../../../src/shared/agent-session/lifecycle/agent-session-record-stored-form' +import '../../../src/shared/agent-session/lifecycle/agent-session-record' +import '../../../src/shared/agent-session/lifecycle/agent-session-provider-handle-encoding' +import '../../../src/shared/protocol-version' import { STRUCTURED_AGENT_SESSION_REGISTERED_AGENTS_RUNTIME_CAPABILITY } from '../../../src/shared/agent-session/structured-agent-session-surface-capabilities' -import { STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY } from '../../../src/shared/agent-session/agent-session-runtime-capabilities' +import '../../../src/shared/agent-session/agent-session-runtime-capabilities' import type { RuntimeMobileSessionTabsSnapshot } from '../../../src/shared/runtime-types' -import { resolveStructuredNativeChatSupport } from '../../../src/shared/structured-native-chat-launch-route' +import '../../../src/shared/structured-native-chat-launch-route' import { parseWorkspaceSession } from '../../../src/shared/workspace-session-schema' import { importReleaseCheckoutModule, @@ -26,7 +23,6 @@ import { } from './release-checkout' import { loadAgentSessionWireBuild, - WORKING_TREE, type AgentSessionWireBuild } from './versioned-agent-session-wire' @@ -49,12 +45,9 @@ type Baseline = { ) => RuntimeMobileSessionTabsSnapshot parseWorkspaceSession: (raw: unknown) => { ok: boolean; value?: unknown } isStructuredTab: (tab: unknown) => boolean - /** The optional list supports releases that gated stored reads on registration. */ - isPersistedAgentSessionRecord: (value: unknown, agents?: unknown) => boolean } let baseline: Baseline -let current: AgentSessionWireBuild // v1.4.228 moved `isStructuredTab` to shared code; keeping both locations lets the rolling baseline // cross that move and an older pinned ref still load. @@ -80,17 +73,15 @@ async function importBaselineStructuredTab( beforeAll(async () => { const ref = resolveBaselineReleaseRef() const checkout = await materializeReleaseCheckout(ref) - const [capabilities, projection, schema, tabs, record] = await Promise.all([ + const [capabilities, projection, schema, tabs] = await Promise.all([ importReleaseCheckoutModule(checkout, 'src/main/ipc/desktop-renderer-runtime-capabilities.ts'), importReleaseCheckoutModule( checkout, 'src/main/runtime/rpc/methods/session-tab-agent-status-projection.ts' ), importReleaseCheckoutModule(checkout, 'src/shared/workspace-session-schema.ts'), - importBaselineStructuredTab(checkout), - importReleaseCheckoutModule(checkout, 'src/shared/agent-session-record.ts') + importBaselineStructuredTab(checkout) ]) - current = await loadAgentSessionWireBuild(WORKING_TREE) const wire = await loadAgentSessionWireBuild(ref) baseline = { ref, @@ -101,8 +92,7 @@ beforeAll(async () => { ), projectSessionTabAgentStatus: releaseModuleExport(projection, 'projectSessionTabAgentStatus'), parseWorkspaceSession: releaseModuleExport(schema, 'parseWorkspaceSession'), - isStructuredTab: releaseModuleExport(tabs, 'isStructuredTab'), - isPersistedAgentSessionRecord: releaseModuleExport(record, 'isPersistedAgentSessionRecord') + isStructuredTab: releaseModuleExport(tabs, 'isStructuredTab') } }, SUITE_TIMEOUT_MS) @@ -111,15 +101,6 @@ function registersAgents(build: AgentSessionWireBuild): boolean { return build.capabilities.includes(STRUCTURED_AGENT_SESSION_REGISTERED_AGENTS_RUNTIME_CAPABILITY) } -function baselineReadsRecord(record: AgentSessionRecord): boolean { - const stored = encodeAgentSessionRecord(record) - return baseline.isPersistedAgentSessionRecord( - // Historical leases keep the checkpoint so old readers reach agent validation. - { ...stored, lease: { ...stored.lease, journalCheckpoint: null } }, - new Set(['claude', 'codex']) - ) -} - // Remove the new capability from the checkout’s real list so the client remains effectively old after release. function oldDesktopClientCapabilities(): string[] { return baseline.desktopClientCapabilities.filter( @@ -127,13 +108,6 @@ function oldDesktopClientCapabilities(): string[] { ) } -/** What a host too old to register agents advertises, derived the same way. */ -function oldHostCapabilities(): string[] { - return baseline.wire.capabilities.filter( - (capability) => capability !== STRUCTURED_AGENT_SESSION_REGISTERED_AGENTS_RUNTIME_CAPABILITY - ) -} - function chatTab(agent: string, isActive: boolean) { return { type: 'agent-session' as const, @@ -200,19 +174,6 @@ function persistedSession(): unknown { } } -function newAgentRecord(): AgentSessionRecord { - const record = agentSessionRecordFixture() - return { - ...record, - provider: NEW_AGENT, - providerHandleChain: record.providerHandleChain.map((link) => ({ - ...link, - handle: { transport: 'acp', agent: NEW_AGENT, nativeId: 'native-session-1' } - })), - accountHome: { variable: 'GROK_HOME', path: '/home/user/.grok' } - } -} - /** A parsed session's chat tabs in the test worktree, read through a named shape. */ const parsedSessionTabs = z.object({ unifiedTabs: z.record(z.string(), z.array(z.record(z.string(), z.unknown()))) @@ -264,83 +225,5 @@ describe('a structured agent beyond Claude and Codex, across versions', () => { unifiedTabsOf(parseWorkspaceSession(persistedSession())).map((tab) => tab.agentSessionAgent) ).toEqual(['claude', NEW_AGENT, 'codex']) }) - - it('classifies a saved new-agent record and keeps Claude and Codex records readable', () => { - // Older admission gates may refuse it; provider-independent releases can read it. - expect(baselineReadsRecord(newAgentRecord())).toBeTypeOf('boolean') - expect(isPersistedAgentSessionRecord(encodeAgentSessionRecord(newAgentRecord()))).toBe(true) - const claude = agentSessionRecordFixture() - const codex: AgentSessionRecord = { - ...claude, - provider: 'codex', - providerHandleChain: claude.providerHandleChain.map((link) => ({ - ...link, - handle: codexProviderHandle('thread-1') - })), - accountHome: { variable: 'CODEX_HOME', path: '/home/user/.codex' } - } - for (const record of [claude, codex]) { - expect(baselineReadsRecord(record)).toBe(true) - } - }) - }) - - describe('new client, old host', () => { - it('does not offer the new agent to a host without the capability', () => { - const host = oldHostCapabilities() - expect( - resolveStructuredNativeChatSupport({ - agent: NEW_AGENT, - executionHostId: 'local', - hostCapabilities: host, - hostStructuredAgents: [NEW_AGENT], - workspaceKind: 'git-worktree' - }) - ).toEqual({ supported: false, blocker: 'runtime-capability' }) - // Claude and Codex are offered exactly when the old host serves structured chats at all. - for (const agent of ['claude', 'codex'] as const) { - expect( - resolveStructuredNativeChatSupport({ - agent, - executionHostId: 'local', - hostCapabilities: host, - workspaceKind: 'git-worktree' - }).supported - ).toBe(host.includes(STRUCTURED_AGENT_SESSION_RUNTIME_CAPABILITY)) - } - }) - }) - - describe('Claude and Codex, both ways', () => { - it('are accepted by both builds as before', async () => { - for (const build of [current, baseline.wire]) { - for (const agent of ['claude', 'codex']) { - const replies: { ok: boolean; result?: unknown }[] = [] - await build.createDispatcher(createSupportRuntime()).dispatchStreaming( - { - id: `create-support-${agent}`, - authToken: 'cross-version-token', - method: 'agentSession.createSupport', - params: { worktree: `id:${WORKTREE}`, agent } - }, - (raw) => replies.push(JSON.parse(raw)), - { clientKind: 'runtime', clientCapabilities: [...RUNTIME_CAPABILITIES] } - ) - expect(replies, `${build.label}: ${agent}`).toEqual([ - expect.objectContaining({ ok: true, result: { supported: true } }) - ]) - } - } - }) }) }) - -/** Enough of a runtime for createSupport to answer: the verdict itself is stubbed. */ -function createSupportRuntime(): unknown { - return { - getRuntimeId: () => 'runtime-1', - getClientSettings: () => ({ experimentalStructuredNativeChat: true }), - getStructuredAgentSessionCreateSupport: async () => ({ supported: true }), - structuredAgentSessionLaunchSeedOptions: () => undefined - } -} diff --git a/tests/e2e/cross-version-wire/cross-version-session-tabs-retirement-proof.unit.test.ts b/tests/e2e/cross-version-wire/cross-version-session-tabs-retirement-proof.unit.test.ts index aa32bf4759be..bb6e47dc0bf2 100644 --- a/tests/e2e/cross-version-wire/cross-version-session-tabs-retirement-proof.unit.test.ts +++ b/tests/e2e/cross-version-wire/cross-version-session-tabs-retirement-proof.unit.test.ts @@ -160,12 +160,6 @@ beforeAll(async () => { }, SUITE_TIMEOUT_MS) describe('cross-version session-tabs retirement proof', () => { - it('old host against old client publishes no proof on the renderer-first close (the defect)', () => { - const frame = hostPublishesOnExit(preStack, snapshotAfterRendererRepublished()) - expect(frame).toBeNull() - expect(clientRetains(preStack, frame)).toEqual([]) - }) - it('new host against new client publishes a proof the client retains (the fix)', () => { const frame = hostPublishesOnExit(stack, snapshotAfterRendererRepublished()) expect(frame).not.toBeNull() diff --git a/tests/e2e/cross-version-wire/cross-version-stopping.unit.test.ts b/tests/e2e/cross-version-wire/cross-version-stopping.unit.test.ts index a8934dae0693..e2d3fcd6d6cc 100644 --- a/tests/e2e/cross-version-wire/cross-version-stopping.unit.test.ts +++ b/tests/e2e/cross-version-wire/cross-version-stopping.unit.test.ts @@ -142,13 +142,6 @@ beforeAll(async () => { }, SUITE_TIMEOUT_MS) describe('cross-version Stopping', () => { - it('pairs two real builds that disagree on the field', () => { - // Prove distinct build identities so the pairing cannot silently collapse into same-version tests. - expect(oldBuild.fold).not.toBe(newBuild.fold) - expect(newBuild.fold(STOPPING_SUMMARY).mainAgent).toMatchObject({ stopping: true }) - expect(oldBuild.fold(STOPPING_SUMMARY).mainAgent).not.toHaveProperty('stopping') - }) - it('an OLD desktop folds a new host summary into the plain working row it always drew', () => { expect(oldBuild.fold(STOPPING_SUMMARY)).toEqual({ state: 'working', diff --git a/tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts b/tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts index 55b448ae11b4..f627b2056909 100644 --- a/tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts +++ b/tests/e2e/cross-version-wire/cross-version-terminal-wire.unit.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeAll, describe, expect, it } from 'vitest' -import { comparePublishedFieldOccurrences, publishedFieldNames } from './published-field-shape' +import { comparePublishedFieldOccurrences } from './published-field-shape' import { resolveBaselineReleaseRef } from './release-checkout' import { JOURNEY_INPUTS, @@ -132,16 +132,6 @@ describe('cross-version remote terminal wire', () => { ]) }) - it('old client against old server completes the journey, and is the reference for an old host', () => { - expect(baselineReference.hostRevision).toBe(baseline.revision) - expect(baselineReference.clientRevision).toBe(baseline.revision) - expectJourneyActuallyRan(baselineReference) - expectWireCompatible(baselineReference) - for (const start of baselineReference.snapshotStarts) { - expect(publishedFieldNames(start).length).toBeGreaterThan(4) - } - }) - it( 'old client against new server completes the journey', async () => { diff --git a/tests/e2e/cross-version-wire/cross-version-worktree-identity-downgrade.unit.test.ts b/tests/e2e/cross-version-wire/cross-version-worktree-identity-downgrade.unit.test.ts index b0100f67d985..de1a1b79339d 100644 --- a/tests/e2e/cross-version-wire/cross-version-worktree-identity-downgrade.unit.test.ts +++ b/tests/e2e/cross-version-wire/cross-version-worktree-identity-downgrade.unit.test.ts @@ -102,17 +102,6 @@ beforeAll(async () => { }, SUITE_TIMEOUT_MS) describe('cross-version worktree identity downgrade', () => { - it('the stack repoints all four', () => { - const state = persistedStateAfterRename() - expect(stackMigrate(state, OLD_ID, NEW_ID)).toBe(true) - expect(rowsById(state)).toEqual({ - sleepingAgentSessionsByPaneKey: NEW_ID, - terminalSurfaceTombstonesByPaneKey: NEW_ID, - closedTerminalTabTombstonesByTabId: NEW_ID, - clientHostedBrowserCloseIntentsByEnvironment: NEW_ID - }) - }) - it('DOWNGRADE: the old build reads new-build state without loss or throw', () => { const state = persistedStateAfterRename() stackMigrate(state, OLD_ID, NEW_ID) diff --git a/tests/e2e/cross-version-wire/preflight-workspace-scoped-downgrade.unit.test.ts b/tests/e2e/cross-version-wire/preflight-workspace-scoped-downgrade.unit.test.ts index 937dd14ed057..b66337ef0809 100644 --- a/tests/e2e/cross-version-wire/preflight-workspace-scoped-downgrade.unit.test.ts +++ b/tests/e2e/cross-version-wire/preflight-workspace-scoped-downgrade.unit.test.ts @@ -136,23 +136,6 @@ describe('workspace-scoped agent detection across versions', () => { ).toEqual(['claude']) }) - it('a new client names the workspace to a new host', async () => { - wire.host = newHost - const store = createTestStore() - - expect(await store.getState().ensureRuntimeDetectedAgents('env-1', WORKTREE)).toEqual([ - 'claude', - 'codex' - ]) - expect(wire.sent).toEqual([ - { - method: 'preflight.detectAgents', - params: { worktreeId: WORKTREE }, - hostSaw: { worktreeId: WORKTREE } - } - ]) - }) - it('an old client gets the host default from a new host', async () => { wire.host = newHost for (const params of [undefined, null]) { diff --git a/tests/e2e/cross-version-wire/release-module-locations.unit.test.ts b/tests/e2e/cross-version-wire/release-module-locations.unit.test.ts deleted file mode 100644 index f0ec9d7f8185..000000000000 --- a/tests/e2e/cross-version-wire/release-module-locations.unit.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { describe, expect, it } from 'vitest' -import { releaseModuleLocation, type ReleaseTree } from './release-module-locations' - -const CURRENT = 'src/shared/agent-session/lifecycle/agent-session-record.ts' -const SHIPPED = 'src/shared/agent-session-record.ts' -const release = (...files: string[]): ReleaseTree => ({ - exists: (path) => files.includes(path), - list: (directory) => files.filter((file) => file.startsWith(`${directory}/`)) -}) - -describe('release module locations', () => { - it('loads a moved module from wherever the release defines it, whichever path a suite names', () => { - for (const named of [CURRENT, SHIPPED, `/${SHIPPED}`]) { - expect(releaseModuleLocation('/release', named, release(SHIPPED))).toBe(SHIPPED) - expect(releaseModuleLocation('/release', named, release(CURRENT))).toBe(CURRENT) - } - }) - - it('stays inside the named source root and passes ambiguous or absent names through', () => { - expect( - releaseModuleLocation('/release', CURRENT, release('src/main/agent-session-record.ts')) - ).toBe(CURRENT) - expect( - releaseModuleLocation( - '/release', - CURRENT, - release(SHIPPED, 'src/shared/old/agent-session-record.ts') - ) - ).toBe(CURRENT) - expect(releaseModuleLocation('/release', CURRENT, release())).toBe(CURRENT) - }) -}) diff --git a/tests/e2e/folder-upgrade-identity-persistence.unit.test.ts b/tests/e2e/folder-upgrade-identity-persistence.unit.test.ts index e2eb9cfa2b7b..712855c88b59 100644 --- a/tests/e2e/folder-upgrade-identity-persistence.unit.test.ts +++ b/tests/e2e/folder-upgrade-identity-persistence.unit.test.ts @@ -96,11 +96,3 @@ it('retains the folder instance and metadata through upgrade, listing, and Store reloaded.flush() expect(createStore().getWorktreeMetaForHost(id, 'local')?.instanceId).toBe(before.instanceId) }) - -it('drops upgrade path evidence when execution ownership changes', () => { - const store = createStore() - store.addRepo(makeRepo({ id: 'folder', path: 'C:\\projects\\draft', kind: 'git' })) - store.updateRepo({ id: 'folder' }, { folderUpgradeGitRootPath: 'C:/projects/draft' }) - store.updateRepo({ id: 'folder' }, { executionHostId: 'ssh:builder' }) - expect(store.getRepo('folder')?.folderUpgradeGitRootPath).toBeUndefined() -}) From a43af245039756eda68c2b4ec725ad449bb6f18f Mon Sep 17 00:00:00 2001 From: OrcaWin Date: Tue, 3 Nov 2026 04:35:53 -0800 Subject: [PATCH 2/2] test: retire obsolete browser schema evidence from active gate --- config/reliability-gates.jsonc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/config/reliability-gates.jsonc b/config/reliability-gates.jsonc index 8a3f3c041c22..996cb6533be0 100644 --- a/config/reliability-gates.jsonc +++ b/config/reliability-gates.jsonc @@ -7931,15 +7931,6 @@ "summary": "Two fresh-build production journeys passed against isolated headed Electron and real headless orca serve hosts, including client ownership, visible retained content, automation, no screencast, new-page-only kill switch, and server fallback without duplicate execution.", "currentCommand": "pnpm exec playwright test tests/e2e/paired-client-hosted-browser.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1" }, - { - "date": "2026-08-16", - "runner": "local", - "platform": "macos", - "command": "pnpm exec vitest run --config config/vitest.config.ts tests/e2e/cross-version-wire/cross-version-browser-placement.unit.test.ts", - "result": "passed", - "durationSeconds": 0.23, - "summary": "Three assertions passed against published v1.4.182 and the current tree: the release lacks the negotiated capabilities, strips additive placement without changing legacy fields, and the current server preserves an old request with omitted placement." - }, { "date": "2026-08-16", "runner": "local", @@ -8017,7 +8008,8 @@ "The packaged skew journey uses one published old package plus the current E2E artifact on macOS; packaged Windows/Linux and a second independently released post-feature package remain unrecorded.", "The live fixture proves routed HTTP, HTTPS, WebSocket, redirect, subresource, and download ownership plus remote DNS through the fixed SOCKS session; worker, speculative, WebRTC, UDP, and DoH containment remain unrecorded.", "The setting currently requires explicit enablement while product rollout policy is decided; disabling it is intentionally new-page-only.", - "The mocked client-placement and immediate create-failure suites were removed, including parameter selection, delayed mocked materialization and no-fallback call ledgers. The remaining live journeys and contracts do not establish equivalent unit alarms. Earlier descriptions and executed results for those fixtures are historical." + "The mocked client-placement and immediate create-failure suites were removed, including parameter selection, delayed mocked materialization and no-fallback call ledgers. The remaining live journeys and contracts do not establish equivalent unit alarms. Earlier descriptions and executed results for those fixtures are historical.", + "The browser-placement schema suite was retired; its initial optional-field inventory is no longer active coverage. Historical local/macos run on 2026-08-16: pnpm exec vitest run --config config/vitest.config.ts tests/e2e/cross-version-wire/cross-version-browser-placement.unit.test.ts; passed in 0.23s. Three assertions passed against published v1.4.182 and the current tree: the release lacks the negotiated capabilities, strips additive placement without changing legacy fields, and the current server preserves an old request with omitted placement. No replacement equivalence is claimed." ], "demotionRule": "Demote if placement changes after creation, a client failure creates a server fallback page, one logical page owns two engines, an omitted or unnegotiated field activates client hosting, the execution route resolves on the viewing desktop, a client page uses screencast/input RPC rendering, automation reaches a different page or engine, delayed publication leaks listeners or causes cleanup of a materialized page, or the kill switch mutates an existing page." },