diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-attach.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-attach.ts index 38595d4e6eb..2e42ffe9893 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-attach.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-attach.ts @@ -324,7 +324,6 @@ export function reserveRequestFor(input: { : {}), ...(authority.launchArgs ? { launchArgs: authority.launchArgs } : {}), ...(authority.launchEnv ? { launchEnv: authority.launchEnv } : {}), - runtimeKind: params.runtimeKind, ...(params.adopt ? { // Fence 1 is a new record's first, and the owner probe requires the head link to carry diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-claude-root-exit.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-claude-root-exit.test.ts index d83ca49a79c..c449711e745 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-claude-root-exit.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-claude-root-exit.test.ts @@ -43,7 +43,6 @@ describe('Claude root-exit eviction', () => { }, provider: 'claude', accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: root }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'spawn-1', claimKeyId: 'key-1', diff --git a/src/main/native-chat/agent-session-wire/structured-agent-session-lease-renewer.test.ts b/src/main/native-chat/agent-session-wire/structured-agent-session-lease-renewer.test.ts index f8323d40fe1..f969e3c0bbf 100644 --- a/src/main/native-chat/agent-session-wire/structured-agent-session-lease-renewer.test.ts +++ b/src/main/native-chat/agent-session-wire/structured-agent-session-lease-renewer.test.ts @@ -26,7 +26,6 @@ async function liveStore(): Promise { }, provider: 'codex', accountHome: { variable: 'CODEX_HOME', path: root }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'spawn-renewal', claimKeyId: 'key-1', 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 105521bbf98..b647ed01883 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 @@ -48,7 +48,6 @@ async function reserve(store: AgentSessionRecordStore) { }, provider: 'codex', accountHome: { variable: 'CODEX_HOME', path: '/tmp/codex' }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'spawn-recovery', claimKeyId: 'key-1', diff --git a/src/main/runtime/agent-session-backup-recovery.test.ts b/src/main/runtime/agent-session-backup-recovery.test.ts index 02866a49fb3..3c6ac2dcecf 100644 --- a/src/main/runtime/agent-session-backup-recovery.test.ts +++ b/src/main/runtime/agent-session-backup-recovery.test.ts @@ -27,7 +27,6 @@ async function seedLiveSession(sessionId: string): Promise { }, provider: 'codex', accountHome: { variable: 'CODEX_HOME', path: join(root, 'codex-home') }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'seed-live', claimKeyId: 'key-1', @@ -101,7 +100,6 @@ async function seedSession(sessionId: string): Promise { }, provider: 'codex', accountHome: { variable: 'CODEX_HOME', path: join(root, 'codex-home') }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'seed', claimKeyId: 'key-1', diff --git a/src/main/runtime/agent-session-conversation-name-store.test.ts b/src/main/runtime/agent-session-conversation-name-store.test.ts index ce5d3fd2621..7310c3fff89 100644 --- a/src/main/runtime/agent-session-conversation-name-store.test.ts +++ b/src/main/runtime/agent-session-conversation-name-store.test.ts @@ -30,7 +30,6 @@ const reserveRequest = (): AgentSessionReserveRequest => ({ location: NATIVE, provider: 'claude', accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: '/home/dev/.claude-work' }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'spawn-a', claimKeyId: 'key-1', diff --git a/src/main/runtime/agent-session-launch-env-admission.test.ts b/src/main/runtime/agent-session-launch-env-admission.test.ts index 97b0f95f2b6..51b2fe64daf 100644 --- a/src/main/runtime/agent-session-launch-env-admission.test.ts +++ b/src/main/runtime/agent-session-launch-env-admission.test.ts @@ -20,7 +20,6 @@ function request(overrides: Partial = {}): AgentSess }, provider: 'codex', accountHome: { variable: 'CODEX_HOME', path: '/home/dev/.codex' }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'spawn-a', claimKeyId: 'key-1', diff --git a/src/main/runtime/agent-session-launch-env-backfill.test.ts b/src/main/runtime/agent-session-launch-env-backfill.test.ts index c95705f2aa5..50cf9e6b35c 100644 --- a/src/main/runtime/agent-session-launch-env-backfill.test.ts +++ b/src/main/runtime/agent-session-launch-env-backfill.test.ts @@ -20,7 +20,6 @@ function request(overrides: Partial = {}): AgentSess }, provider: 'claude', accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: '/home/dev/.claude' }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'spawn-a', claimKeyId: 'key-1', diff --git a/src/main/runtime/agent-session-lease-renewal.test.ts b/src/main/runtime/agent-session-lease-renewal.test.ts index 0c1c88db003..b2788f81602 100644 --- a/src/main/runtime/agent-session-lease-renewal.test.ts +++ b/src/main/runtime/agent-session-lease-renewal.test.ts @@ -27,7 +27,6 @@ async function establishOwner( }, provider: 'codex', accountHome: { variable: 'CODEX_HOME', path: directory }, - runtimeKind: 'native', expectedFence: null, spawnToken, claimKeyId: 'key-1', diff --git a/src/main/runtime/agent-session-lease-transitions.ts b/src/main/runtime/agent-session-lease-transitions.ts index 92c0ae27465..580fbeda255 100644 --- a/src/main/runtime/agent-session-lease-transitions.ts +++ b/src/main/runtime/agent-session-lease-transitions.ts @@ -19,13 +19,11 @@ import { import type { AgentSessionJournalCheckpoint, AgentSessionLease, - AgentSessionOwnerRuntimeKind, AgentSessionProcessIdentity, AgentSessionRecord } from '../../shared/agent-session-record' export type AgentSessionReservation = { - runtimeKind: AgentSessionOwnerRuntimeKind spawnToken: string claimKeyId: string handoffOperationId: string | null @@ -76,7 +74,7 @@ export function reserveAgentSessionOwner(args: { disposition: 'reserved', record: withLease(record, { ...record.lease, - runtimeKind: reservation.runtimeKind, + runtimeKind: 'native', runtimeFence: decision.nextFence, // Why: a reserved owner is not yet a writer; it may only talk to the provider to prove resume. handoffStage: 'new-owner-proving', diff --git a/src/main/runtime/agent-session-record-options.test.ts b/src/main/runtime/agent-session-record-options.test.ts index 5795763d96c..5ba7c41cffc 100644 --- a/src/main/runtime/agent-session-record-options.test.ts +++ b/src/main/runtime/agent-session-record-options.test.ts @@ -57,7 +57,6 @@ it('persists resumed provider options atomically with owner proof', async () => }, provider: 'codex', accountHome: { variable: 'CODEX_HOME', path: '/accounts/codex' }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'spawn-options', claimKeyId: 'key-1', diff --git a/src/main/runtime/agent-session-record-store-legacy-handoff-lease.test.ts b/src/main/runtime/agent-session-record-store-legacy-handoff-lease.test.ts index 997e32fb7cb..77d94766212 100644 --- a/src/main/runtime/agent-session-record-store-legacy-handoff-lease.test.ts +++ b/src/main/runtime/agent-session-record-store-legacy-handoff-lease.test.ts @@ -44,7 +44,6 @@ async function persistLiveOwner(): Promise { }, provider: 'claude', accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: '/home/dev/.claude-work' }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'spawn-a', claimKeyId: 'key-1', diff --git a/src/main/runtime/agent-session-record-store-security.test.ts b/src/main/runtime/agent-session-record-store-security.test.ts index f70145cf5a2..63ee368f873 100644 --- a/src/main/runtime/agent-session-record-store-security.test.ts +++ b/src/main/runtime/agent-session-record-store-security.test.ts @@ -20,7 +20,6 @@ function reserveRequest(): AgentSessionReserveRequest { }, provider: 'codex', accountHome: { variable: 'CODEX_HOME', path: '/accounts/created' }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'spawn-created', claimKeyId: 'key-1', diff --git a/src/main/runtime/agent-session-record-store-surface-tab-id.test.ts b/src/main/runtime/agent-session-record-store-surface-tab-id.test.ts index 20ee4b402fd..f9603e7a86b 100644 --- a/src/main/runtime/agent-session-record-store-surface-tab-id.test.ts +++ b/src/main/runtime/agent-session-record-store-surface-tab-id.test.ts @@ -48,7 +48,6 @@ function reserveRequest( location: NATIVE, provider: 'claude', accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: '/home/dev/.claude-work' }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'spawn-a', claimKeyId: 'key-1', diff --git a/src/main/runtime/agent-session-record-store.test.ts b/src/main/runtime/agent-session-record-store.test.ts index d3525de2de9..65d689503c2 100644 --- a/src/main/runtime/agent-session-record-store.test.ts +++ b/src/main/runtime/agent-session-record-store.test.ts @@ -57,7 +57,6 @@ function reserveRequest( location: NATIVE, provider: 'claude', accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: '/home/dev/.claude-work' }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'spawn-a', claimKeyId: 'key-1', diff --git a/src/main/runtime/agent-session-record-unsupported-schema.test.ts b/src/main/runtime/agent-session-record-unsupported-schema.test.ts index 1f807870682..dd0a9dcd28d 100644 --- a/src/main/runtime/agent-session-record-unsupported-schema.test.ts +++ b/src/main/runtime/agent-session-record-unsupported-schema.test.ts @@ -25,7 +25,6 @@ function reserveRequest(): AgentSessionReserveRequest { }, provider: 'codex', accountHome: { variable: 'CODEX_HOME', path: '/home/user/.codex' }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'spawn-new', claimKeyId: 'key-1', diff --git a/src/main/runtime/agent-session-reservation-admission.test.ts b/src/main/runtime/agent-session-reservation-admission.test.ts index 30d54a108c9..83e9c610056 100644 --- a/src/main/runtime/agent-session-reservation-admission.test.ts +++ b/src/main/runtime/agent-session-reservation-admission.test.ts @@ -50,7 +50,6 @@ function reserveRequest( location: LOCATION, provider: 'claude', accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: '/home/dev/.claude' }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'spawn-a', claimKeyId: 'key-1', diff --git a/src/main/runtime/agent-session-reservation-admission.ts b/src/main/runtime/agent-session-reservation-admission.ts index d7a84f6ef69..4bd3bf9b4db 100644 --- a/src/main/runtime/agent-session-reservation-admission.ts +++ b/src/main/runtime/agent-session-reservation-admission.ts @@ -62,7 +62,6 @@ export type AgentSessionReserveRequest = { /** Set only when this create adopts an existing provider conversation. Seeds the handle chain so * the adapter resumes; without it a new record has never proved a thread and starts a fresh one. */ adoptedHandleLink?: AgentSessionProviderHandleLink - runtimeKind: AgentSessionReservation['runtimeKind'] /** Null when the session does not exist yet; otherwise the fence the caller last observed. */ expectedFence: number | null /** A supplier is invoked only when this operation wins a new reservation. */ @@ -154,7 +153,6 @@ export function applyAgentSessionReservation( throw new Error('agent_session_options_invalid') } const reservation: AgentSessionReservation = { - runtimeKind: request.runtimeKind, spawnToken: typeof request.spawnToken === 'function' ? request.spawnToken() : request.spawnToken, claimKeyId: request.claimKeyId, @@ -283,7 +281,7 @@ function createAgentSessionRecord( updatedAt: request.now, lease: { sessionId: request.sessionId, - runtimeKind: reservation.runtimeKind, + runtimeKind: 'native', // Why: fence 1 is the first reservation; 0 is reserved for "no owner has ever existed". runtimeFence: 1, handoffStage: 'new-owner-proving', diff --git a/src/main/runtime/agent-session-unreadable-record-salvage.test.ts b/src/main/runtime/agent-session-unreadable-record-salvage.test.ts index 0d44d88d82b..cde4091d7eb 100644 --- a/src/main/runtime/agent-session-unreadable-record-salvage.test.ts +++ b/src/main/runtime/agent-session-unreadable-record-salvage.test.ts @@ -34,7 +34,6 @@ function reserveRequest( }, provider: 'claude', accountHome: { variable: 'CLAUDE_CONFIG_DIR', path: '/home/dev/.claude-work' }, - runtimeKind: 'native', expectedFence: null, spawnToken: 'spawn-a', claimKeyId: 'key-1', diff --git a/src/main/runtime/agent-session-unsaved-creation-supersession.test.ts b/src/main/runtime/agent-session-unsaved-creation-supersession.test.ts index ec2a1e82e92..50d27baa57a 100644 --- a/src/main/runtime/agent-session-unsaved-creation-supersession.test.ts +++ b/src/main/runtime/agent-session-unsaved-creation-supersession.test.ts @@ -26,7 +26,6 @@ function reserveRequest( }, provider: 'codex', accountHome: { variable: 'CODEX_HOME', path: '/home/dev/.codex' }, - runtimeKind: 'native', expectedFence: null, spawnToken: `spawn-${operations}`, claimKeyId: 'key-1',