Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(desktop-ui): remove the unreachable rename alternative from the revoked matcher

Alfredo Lopez62f6968f0fac
diff --git a/desktop-app/ui/src/hooks/domain/__tests__/chatListTitleMerge.test.tsx b/desktop-app/ui/src/hooks/domain/__tests__/chatListTitleMerge.test.tsx
index 68bc0b786..e3b079bbb 100644
--- a/desktop-app/ui/src/hooks/domain/__tests__/chatListTitleMerge.test.tsx
+++ b/desktop-app/ui/src/hooks/domain/__tests__/chatListTitleMerge.test.tsx
@@ -13,6 +13,10 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { makeTaskKey } from '@contexts/AgentTaskTrackerContext'
import { act, waitFor } from '@testing-library/react'
import type { SessionsListResult } from '../../../../../src/types'
+import {
+ HOST_ACCESS_REVOKED_CODE,
+ HOST_ACCESS_REVOKED_MESSAGE,
+} from '../../../../../src/upstreamErrors'
import { httpErrorStatus, isConfirmedHostAccessRevoked } from '../../../lib/format'
import { deferred, localIndex, serverSessions } from './__fixtures__/catalogFixtures'
import { renderController } from './__fixtures__/controllerHarness'
@@ -112,6 +116,23 @@ describe('HTTP status parsing through Electron IPC', () => {
expect(httpErrorStatus(error)).toBe(status)
expect(isConfirmedHostAccessRevoked(error)).toBe(revoked)
})
+
+ // R3-L16: only the upstream projection's exact text confirms a revocation.
+ // No producer emits a rename-prefixed revocation, so that spelling is not
+ // accepted either; every case still carries a parsed 403.
+ it.each([
+ ['the IPC-wrapped Host-wide revocation', HOST_ACCESS_REVOKED_MESSAGE, true],
+ [
+ 'a rename-prefixed revocation no producer emits',
+ `Rename session failed (403): ${HOST_ACCESS_REVOKED_CODE}`,
+ false,
+ ],
+ ['the real generic rename denial', 'Rename session failed (403)', false],
+ ])('confirms revocation only for %s', (_label, message, revoked) => {
+ const error = wrapLikeElectronIpc('rpc:renameSession', new Error(message))
+ expect(httpErrorStatus(error)).toBe(403)
+ expect(isConfirmedHostAccessRevoked(error)).toBe(revoked)
+ })
})
describe('chat list title merge (spec 15 §2.2, cases A–D)', () => {
diff --git a/desktop-app/ui/src/lib/format.ts b/desktop-app/ui/src/lib/format.ts
index e2163e33b..5f6efc41a 100644
--- a/desktop-app/ui/src/lib/format.ts
+++ b/desktop-app/ui/src/lib/format.ts
@@ -245,9 +245,7 @@ export function isHttp403(err: unknown): boolean {
export function isConfirmedHostAccessRevoked(err: unknown): boolean {
return (
httpErrorStatus(err) === 403 &&
- /(?:^|error: )(?:403 forbidden: host_access_revoked|rename session failed \(403\): host_access_revoked)$/.test(
- errorText(err)
- )
+ /(?:^|error: )403 forbidden: host_access_revoked$/.test(errorText(err))
)
}