Skip to content

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

TypeScript

Merge remote-tracking branch 'origin/dev' into feat/mcp-connectors-desktop-refactor

Diego Zacariasdb9a509936fd
diff --cc control-ui/lib/codexSubscription.ts
index 4ff61bc91,3ef5c69cd..5fb0cdff7
--- a/control-ui/lib/codexSubscription.ts
+++ b/control-ui/lib/codexSubscription.ts
@@@ -2,12 -2,11 +2,15 @@@ import { apiGet, apiSend } from './api
export const CODEX_SUBSCRIPTION_API_BASE = '/api/v1/admin/llm/providers/codex-subscription'
+ /** Canonical ChatGPT device verification page. Reject any other href from device/start. */
+ export const CODEX_DEVICE_VERIFICATION_URI = 'https://auth.openai.com/codex/device'
+
export type CodexConnectionStatus =
- 'disconnected' | 'connecting' | 'connected' | 'reauth_required' | 'revoked'
+ | 'disconnected'
+ | 'connecting'
+ | 'connected'
+ | 'reauth_required'
+ | 'revoked'
export type CodexCatalogStatus = 'never_synced' | 'ready' | 'auth-rejected' | 'unavailable'
diff --cc desktop-app/src/__tests__/config.onboardingPreview.test.ts
index 000000000,79c915389..8a830423c
mode 000000,100644..100644
--- a/desktop-app/src/__tests__/config.onboardingPreview.test.ts
+++ b/desktop-app/src/__tests__/config.onboardingPreview.test.ts
@@@ -1,0 -1,162 +1,159 @@@
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+ import fs from 'node:fs'
+ import os from 'node:os'
+ import path from 'node:path'
+
+ const testUserDataDir = fs.mkdtempSync(path.join(os.tmpdir(), 'evenfire-test-userdata-'))
+
+ vi.mock('electron', () => ({
+ app: {
+ getPath: vi.fn(() => testUserDataDir),
+ isPackaged: false,
+ isReady: vi.fn(() => true),
+ setName: vi.fn(),
+ setPath: vi.fn(),
+ getName: vi.fn(() => 'Evenfire'),
+ },
+ }))
+
+ const LOCALHOST_EXTERNAL = 'http://127.0.0.1:8091'
+ const LOCALHOST_RPC = 'http://127.0.0.1:8094'
+
+ async function loadState() {
+ vi.resetModules()
+ const config = await import('../config.js')
+ // getDesktopRuntimeConfigState hydrates first, so this is the value the
+ // renderer actually receives — not the pre-hydrate one.
+ return config.getDesktopRuntimeConfigState()
+ }
+
+ describe('EVENFIRE_ONBOARDING_PREVIEW', () => {
+ const saved = {
+ external: process.env.EXTERNAL_REST_API_BASE_URL,
+ rpc: process.env.RPC_PROXY_BASE_URL,
+ preview: process.env.EVENFIRE_ONBOARDING_PREVIEW,
+ explicit: process.env.CLERUM_DESKTOP_CONFIG_PATH,
+ }
+
+ beforeEach(() => {
+ delete process.env.EVENFIRE_ONBOARDING_PREVIEW
+ delete process.env.CLERUM_DESKTOP_CONFIG_PATH
+ })
+
+ afterEach(() => {
+ for (const [key, value] of [
+ ['EXTERNAL_REST_API_BASE_URL', saved.external],
+ ['RPC_PROXY_BASE_URL', saved.rpc],
+ ['EVENFIRE_ONBOARDING_PREVIEW', saved.preview],
+ ['CLERUM_DESKTOP_CONFIG_PATH', saved.explicit],
+ ] as const) {
+ if (value === undefined) delete process.env[key]
+ else process.env[key] = value
+ }
+ vi.resetModules()
+ })
+
+ it('defaults to off: an env-configured app stays configured', async () => {
+ process.env.EXTERNAL_REST_API_BASE_URL = LOCALHOST_EXTERNAL
+ process.env.RPC_PROXY_BASE_URL = LOCALHOST_RPC
+
+ expect((await loadState()).configured).toBe(true)
+ })
+
+ it('ignores any value other than "true"', async () => {
+ process.env.EXTERNAL_REST_API_BASE_URL = LOCALHOST_EXTERNAL
+ process.env.RPC_PROXY_BASE_URL = LOCALHOST_RPC
+ process.env.EVENFIRE_ONBOARDING_PREVIEW = 'false'
+
+ expect((await loadState()).configured).toBe(true)
+
+ process.env.EVENFIRE_ONBOARDING_PREVIEW = '1'
+ expect((await loadState()).configured).toBe(true)
+ })
+
+ it('starts cold when enabled, even with the make local-app runtime vars set', async () => {
+ process.env.EXTERNAL_REST_API_BASE_URL = LOCALHOST_EXTERNAL
+ process.env.RPC_PROXY_BASE_URL = LOCALHOST_RPC
+ process.env.EVENFIRE_ONBOARDING_PREVIEW = 'true'
+
+ // configured === false is what routes the renderer to onboarding.
+ expect((await loadState()).configured).toBe(false)
+ })
+
+ it('reads and writes a separate directory, never the real runtime config', async () => {
+ process.env.EVENFIRE_ONBOARDING_PREVIEW = 'true'
+ const previewPath = (await loadState()).storagePath
+
+ delete process.env.EVENFIRE_ONBOARDING_PREVIEW
+ const realPath = (await loadState()).storagePath
+
+ expect(previewPath).not.toBe(realPath)
+ expect(previewPath).toContain('runtime-configs-onboarding-preview')
+ expect(realPath).toMatch(/runtime-configs$/)
+ })
+
+ it('survives hydration under a real `make local-app` launch', async () => {
+ // Regression: hydrateDesktopRuntimeConfig re-pinned the Localhost option
+ // whenever the app was launched with --evenfire-desktop-dev-package AND
+ // localhost endpoints — exactly what `make local-app` does. That flipped
+ // `configured` back to true after boot, so the app opened on sign-in while
+ // the boot log still claimed onboarding.
+ process.argv.push('--evenfire-desktop-dev-package')
+ try {
+ process.env.EXTERNAL_REST_API_BASE_URL = LOCALHOST_EXTERNAL
+ process.env.RPC_PROXY_BASE_URL = LOCALHOST_RPC
+ process.env.EVENFIRE_ONBOARDING_PREVIEW = 'true'
+
+ const state = await loadState()
+
+ expect(state.configured).toBe(false)
+ expect(state.activeOptionId).not.toBe('__localhost__')
+ } finally {
+ process.argv = process.argv.filter(a => a !== '--evenfire-desktop-dev-package')
+ }
+ })
+
+ it('still pins Localhost for a dev-package launch when preview is off', async () => {
+ process.argv.push('--evenfire-desktop-dev-package')
+ try {
+ process.env.EXTERNAL_REST_API_BASE_URL = LOCALHOST_EXTERNAL
+ process.env.RPC_PROXY_BASE_URL = LOCALHOST_RPC
+
+ const state = await loadState()
+
+ expect(state.configured).toBe(true)
+ } finally {
+ process.argv = process.argv.filter(a => a !== '--evenfire-desktop-dev-package')
+ }
+ })
+
+ it('starts cold again after a previous preview selected an environment', async () => {
+ // Regression: selecting Localhost (or saving) inside the preview wrote
+ // activeProfileId into the preview's own directory, so the NEXT launch
+ // came up configured and went to sign-in. The switch showed onboarding
+ // once and then quietly stopped working.
- const previewDir = path.join(
- testUserDataDir,
- 'runtime-configs-onboarding-preview'
- )
++ const previewDir = path.join(testUserDataDir, 'runtime-configs-onboarding-preview')
+ fs.mkdirSync(previewDir, { recursive: true })
+ fs.writeFileSync(
+ path.join(previewDir, 'index.json'),
+ JSON.stringify({ version: 1, activeProfileId: '__localhost__', profiles: [] })
+ )
+
+ process.env.EVENFIRE_ONBOARDING_PREVIEW = 'true'
+
+ const state = await loadState()
+
+ expect(state.configured).toBe(false)
+ expect(state.activeOptionId).not.toBe('__localhost__')
+ })
+
+ it('does not let an explicit config path hand the preview an environment', async () => {
+ process.env.EVENFIRE_ONBOARDING_PREVIEW = 'true'
+ process.env.CLERUM_DESKTOP_CONFIG_PATH = '/tmp/evenfire-explicit/runtime-config.json'
+
+ const state = await loadState()
+
+ expect(state.configured).toBe(false)
+ expect(state.storagePath).toContain('runtime-configs-onboarding-preview')
+ })
+ })
diff --cc desktop-app/ui/src/App.tsx
index 33e1c64d4,c01a136f8..a87222af4
--- a/desktop-app/ui/src/App.tsx
+++ b/desktop-app/ui/src/App.tsx
@@@ -65,8 -65,11 +65,9 @@@ import
import { AgentsPage } from '@pages/AgentsPage'
import { AuthPage } from '@pages/AuthPage'
import { ChatPage } from '@pages/ChatPage'
-import { ContextDetailsPage } from '@pages/ContextDetailsPage'
-import { ContextsPage } from '@pages/ContextsPage'
import { FilesPage } from '@pages/FilesPage'
import { McpServersPage } from '@pages/McpServersPage'
+ import { OnboardingPage } from '@pages/OnboardingPage'
import { SandboxUiPage } from '@pages/SandboxUiPage'
import type {
SandboxUiConversationOrigin,
diff --cc desktop-app/ui/src/hooks/useAppController.ts
index a90eafff1,bda50907d..356b88218
--- a/desktop-app/ui/src/hooks/useAppController.ts
+++ b/desktop-app/ui/src/hooks/useAppController.ts
@@@ -8,9 -8,10 +8,10 @@@ import type
WorkflowRecipeResource,
WorkflowRunsResult,
} from '../../../src/types'
-import { DESKTOP_ROUTES } from '../constants/navigation'
+import { AGENT_WORKSPACE_ROUTES, DESKTOP_ROUTES } from '../constants/navigation'
import { pickLatestAgent } from '../lib/agents'
import { toPrettyJson } from '../lib/format'
+ import { selectUnauthenticatedView } from '../lib/unauthenticatedView'
import { summarizeWorkflowResource } from '../lib/workflows'
import type {
AgentApprovalNotificationTarget,
diff --cc mcp-host/package-lock.json
index 79c2c67d1,79c2c67d1..39de989fe
--- a/mcp-host/package-lock.json
+++ b/mcp-host/package-lock.json
@@@ -1,12 -1,12 +1,12 @@@
{
"name": "clerum-mcp-host",
-- "version": "0.1.303",
++ "version": "0.1.304",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-mcp-host",
-- "version": "0.1.303",
++ "version": "0.1.304",
"license": "SEE LICENSE IN LICENSE",
"dependencies": {
"@anthropic-ai/sdk": "^0.32.0",
diff --cc mcp-host/package.json
index 5384b9af6,5384b9af6..84c36a4dd
--- a/mcp-host/package.json
+++ b/mcp-host/package.json
@@@ -1,6 -1,6 +1,6 @@@
{
"name": "clerum-mcp-host",
-- "version": "0.1.303",
++ "version": "0.1.304",
"description": "MCP Host - reads Host CRD and provides LLM access via OpenAI/Claude",
"main": "dist/main.js",
"engines": {