Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1316ead
completly remove sandbox related code as the downstream libraries do …
webdevcody Jan 7, 2026
11accac
feat: implement API-first settings management and description history…
webdevcody Jan 7, 2026
0d206fe
feat: enhance login view with session verification and loading state
webdevcody Jan 7, 2026
9274510
feat: add sandbox risk confirmation and rejection screens
webdevcody Jan 7, 2026
70c04b5
feat: update session cookie options and enhance authentication flow
webdevcody Jan 7, 2026
e58e389
feat: implement settings migration from localStorage to server
webdevcody Jan 7, 2026
4d36e66
refactor: update session cookie options and improve login view authen…
webdevcody Jan 7, 2026
cfa1f11
Merge branch 'v0.9.0rc' into remove-sandbox-as-it-is-broken
webdevcody Jan 7, 2026
b9fcb91
fix: add missing checkSandboxCompatibility function to sdk-options
webdevcody Jan 7, 2026
7176d3e
fix: enhance sandbox compatibility checks in sdk-options and improve …
webdevcody Jan 7, 2026
11b1bbc
feat: implement splash screen handling in navigation and interactions
webdevcody Jan 7, 2026
763f983
feat: enhance test setup with splash screen handling and sandbox warn…
webdevcody Jan 7, 2026
8b36fce
refactor: improve test stability and clarity in various test cases
webdevcody Jan 7, 2026
f737b1f
merge in v0.9.0
webdevcody Jan 7, 2026
47c2d79
chore: update e2e test results upload configuration
webdevcody Jan 8, 2026
8c68c24
feat: implement Codex CLI authentication check and integrate with pro…
webdevcody Jan 8, 2026
d8cdb0b
feat: enhance global settings update with data loss prevention
webdevcody Jan 8, 2026
eb627ef
feat: enhance E2E test setup and error handling
webdevcody Jan 8, 2026
8992f66
refactor: clean up settings service and improve E2E fixture descriptions
webdevcody Jan 8, 2026
dc264bd
feat: update E2E fixture settings and improve test repository initial…
webdevcody Jan 8, 2026
69434fe
feat: enhance login view with retry mechanism for server checks
webdevcody Jan 8, 2026
959467d
feat: add UI test command and clean up integration test
webdevcody Jan 8, 2026
fd5f7b8
fix: improve worktree branch handling in list route
webdevcody Jan 8, 2026
96fe90c
chore: remove worktree integration E2E test file
webdevcody Jan 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ jobs:
path: apps/ui/playwright-report/
retention-days: 7

- name: Upload test results
- name: Upload test results (screenshots, traces, videos)
uses: actions/upload-artifact@v4
if: failure()
if: always()
with:
name: test-results
path: apps/ui/test-results/
path: |
apps/ui/test-results/
retention-days: 7
if-no-files-found: ignore
2 changes: 1 addition & 1 deletion apps/server/src/lib/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export function getSessionCookieOptions(): {
return {
httpOnly: true, // JavaScript cannot access this cookie
secure: process.env.NODE_ENV === 'production', // HTTPS only in production
sameSite: 'strict', // Only sent for same-site requests (CSRF protection)
sameSite: 'lax', // Sent for same-site requests and top-level navigations, but not cross-origin fetch/XHR
maxAge: SESSION_MAX_AGE_MS,
path: '/',
};
Expand Down
98 changes: 98 additions & 0 deletions apps/server/src/lib/codex-auth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
/**
* Shared utility for checking Codex CLI authentication status
*
* Uses 'codex login status' command to verify authentication.
* Never assumes authenticated - only returns true if CLI confirms.
*/

import { spawnProcess, getCodexAuthPath } from '@automaker/platform';
import { findCodexCliPath } from '@automaker/platform';
import * as fs from 'fs';

const CODEX_COMMAND = 'codex';
const OPENAI_API_KEY_ENV = 'OPENAI_API_KEY';

export interface CodexAuthCheckResult {
authenticated: boolean;
method: 'api_key_env' | 'cli_authenticated' | 'none';
}

/**
* Check Codex authentication status using 'codex login status' command
*
* @param cliPath Optional CLI path. If not provided, will attempt to find it.
* @returns Authentication status and method
*/
export async function checkCodexAuthentication(
cliPath?: string | null
): Promise<CodexAuthCheckResult> {
console.log('[CodexAuth] checkCodexAuthentication called with cliPath:', cliPath);

const resolvedCliPath = cliPath || (await findCodexCliPath());
const hasApiKey = !!process.env[OPENAI_API_KEY_ENV];

console.log('[CodexAuth] resolvedCliPath:', resolvedCliPath);
console.log('[CodexAuth] hasApiKey:', hasApiKey);

// Debug: Check auth file
const authFilePath = getCodexAuthPath();
console.log('[CodexAuth] Auth file path:', authFilePath);
try {
const authFileExists = fs.existsSync(authFilePath);
console.log('[CodexAuth] Auth file exists:', authFileExists);
if (authFileExists) {
const authContent = fs.readFileSync(authFilePath, 'utf-8');
console.log('[CodexAuth] Auth file content:', authContent.substring(0, 500)); // First 500 chars
}
} catch (error) {
console.log('[CodexAuth] Error reading auth file:', error);
}

// If CLI is not installed, cannot be authenticated
if (!resolvedCliPath) {
console.log('[CodexAuth] No CLI path found, returning not authenticated');
return { authenticated: false, method: 'none' };
}

try {
console.log('[CodexAuth] Running: ' + resolvedCliPath + ' login status');
const result = await spawnProcess({
command: resolvedCliPath || CODEX_COMMAND,
args: ['login', 'status'],
cwd: process.cwd(),
env: {
...process.env,
TERM: 'dumb', // Avoid interactive output
},
});

console.log('[CodexAuth] Command result:');
console.log('[CodexAuth] exitCode:', result.exitCode);
console.log('[CodexAuth] stdout:', JSON.stringify(result.stdout));
console.log('[CodexAuth] stderr:', JSON.stringify(result.stderr));

// Check both stdout and stderr for "logged in" - Codex CLI outputs to stderr
const combinedOutput = (result.stdout + result.stderr).toLowerCase();
const isLoggedIn = combinedOutput.includes('logged in');
console.log('[CodexAuth] isLoggedIn (contains "logged in" in stdout or stderr):', isLoggedIn);

if (result.exitCode === 0 && isLoggedIn) {
// Determine auth method based on what we know
const method = hasApiKey ? 'api_key_env' : 'cli_authenticated';
console.log('[CodexAuth] Authenticated! method:', method);
return { authenticated: true, method };
}

console.log(
'[CodexAuth] Not authenticated. exitCode:',
result.exitCode,
'isLoggedIn:',
isLoggedIn
);
} catch (error) {
console.log('[CodexAuth] Error running command:', error);
}

console.log('[CodexAuth] Returning not authenticated');
return { authenticated: false, method: 'none' };
}
Loading