fix(daemon): replace hosts with stale login preflight cache

Protocol 26 shipped the process-lifetime PAM rejection cache. Preserve its live sessions as a legacy generation, but route fresh terminals through protocol 27 so updating actually loads the expiring-cache fix.

Refs #9756
This commit is contained in:
Brennan Benson
2026-07-22 14:34:40 -07:00
parent d9e19d83e7
commit e38fae9f68
3 changed files with 7 additions and 5 deletions
@@ -3,11 +3,12 @@ import { PREVIOUS_DAEMON_PROTOCOL_VERSIONS, PROTOCOL_VERSION } from './types'
describe('foreground-confirmation daemon protocol', () => {
it('rejects daemons from before the fresh-confirmation RPC', () => {
expect(PROTOCOL_VERSION).toBe(26)
expect(PROTOCOL_VERSION).toBe(27)
expect(PREVIOUS_DAEMON_PROTOCOL_VERSIONS).toContain(19)
expect(PREVIOUS_DAEMON_PROTOCOL_VERSIONS).toContain(22)
expect(PREVIOUS_DAEMON_PROTOCOL_VERSIONS).toContain(23)
expect(PREVIOUS_DAEMON_PROTOCOL_VERSIONS).toContain(24)
expect(PREVIOUS_DAEMON_PROTOCOL_VERSIONS).toContain(25)
expect(PREVIOUS_DAEMON_PROTOCOL_VERSIONS).toContain(26)
})
})
@@ -8,11 +8,11 @@ import {
describe('daemon protocol version', () => {
it('ships claim and incarnation authority after startup-ingress generations', () => {
expect(PROTOCOL_VERSION).toBe(26)
expect(PROTOCOL_VERSION).toBe(27)
expect(AGENT_SESSION_CLAIM_DAEMON_PROTOCOL_VERSION).toBe(26)
expect(AGENT_SESSION_CREATE_OPERATION_DAEMON_PROTOCOL_VERSION).toBe(26)
expect(PREVIOUS_DAEMON_PROTOCOL_VERSIONS).toEqual(
Array.from({ length: 25 }, (_, index) => index + 1)
Array.from({ length: 26 }, (_, index) => index + 1)
)
})
})
+3 -2
View File
@@ -1,12 +1,13 @@
// Why: daemons survive app updates, so wire behavior must be version-gated.
export const PROTOCOL_VERSION = 26
// v27 replaces v26 daemons that can retain permanent macOS preflight rejections (#9756).
export const PROTOCOL_VERSION = 27
export const PTY_STARTUP_INGRESS_PROTOCOL_VERSION = 25
export const AGENT_SESSION_CLAIM_DAEMON_PROTOCOL_VERSION = 26
export const AGENT_SESSION_CREATE_OPERATION_DAEMON_PROTOCOL_VERSION = 26
export const GIT_CREDENTIAL_GUARD_HOST_PROTOCOL_VERSION = 22
export const CLEAN_DISCONNECT_PROTOCOL_VERSION = 24
export const PREVIOUS_DAEMON_PROTOCOL_VERSIONS = [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26
] as const
export function supportsPtyStartupIngress(protocolVersion: number): boolean {