Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
1 change: 0 additions & 1 deletion .ade/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ local.secret.yaml
ade.db
ade.db-*
ade.db-wal
*.bak
embeddings.db
mcp.sock
artifacts/
Expand Down
7 changes: 2 additions & 5 deletions .ade/cto/identity.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: CTO
version: 2
version: 1
persona: >-
You are the CTO for this project inside ADE.

Expand Down Expand Up @@ -28,7 +28,4 @@ openclawContextPolicy:
- secret
- token
- system_prompt
onboardingState:
completedSteps: []
dismissedAt: 2026-04-01T23:35:05.209Z
updatedAt: 2026-04-01T23:35:05.211Z
updatedAt: 1970-01-01T00:00:00.000Z
7 changes: 7 additions & 0 deletions apps/desktop/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"@radix-ui/react-tabs": "^1.1.13",
"@tanstack/react-virtual": "^3.13.21",
"@xterm/addon-fit": "^0.11.0",
"@xterm/addon-webgl": "^0.19.0",
"@xterm/xterm": "^6.0.0",
"@xyflow/react": "^12.5.0",
"ai": "^6.0.141",
Expand Down
62 changes: 39 additions & 23 deletions apps/desktop/src/main/services/ai/authDetector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}

vi.mock("node:child_process", async () => {
const actual = await vi.importActual<typeof import("node:child_process")>("node:child_process");

Check warning on line 39 in apps/desktop/src/main/services/ai/authDetector.test.ts

View workflow job for this annotation

GitHub Actions / lint-desktop

`import()` type annotations are forbidden
return {
...actual,
spawn: (...args: unknown[]) => spawnMock(...args),
Expand All @@ -49,9 +49,9 @@
}));

// Import AFTER mocks are set up — must re-import to reset the module-level cache.
let detectAllAuth: typeof import("./authDetector").detectAllAuth;

Check warning on line 52 in apps/desktop/src/main/services/ai/authDetector.test.ts

View workflow job for this annotation

GitHub Actions / lint-desktop

`import()` type annotations are forbidden
let detectCliAuthStatuses: typeof import("./authDetector").detectCliAuthStatuses;

Check warning on line 53 in apps/desktop/src/main/services/ai/authDetector.test.ts

View workflow job for this annotation

GitHub Actions / lint-desktop

`import()` type annotations are forbidden
let verifyProviderApiKey: typeof import("./authDetector").verifyProviderApiKey;

Check warning on line 54 in apps/desktop/src/main/services/ai/authDetector.test.ts

View workflow job for this annotation

GitHub Actions / lint-desktop

`import()` type annotations are forbidden
const originalPlatform = process.platform;

function setPlatform(value: NodeJS.Platform): void {
Expand Down Expand Up @@ -260,38 +260,54 @@
it("finds codex through an npm-global prefix when PATH lookup fails", async () => {
tempHomeDir = fs.mkdtempSync(path.join(os.tmpdir(), "ade-auth-detector-"));
const prefixDir = path.join(tempHomeDir, ".npm-global");
const preferredCodexPath = path.join(prefixDir, "bin", "codex");
fs.mkdirSync(path.join(prefixDir, "bin"), { recursive: true });
fs.writeFileSync(path.join(tempHomeDir, ".npmrc"), "prefix=~/.npm-global\n", "utf8");
fs.writeFileSync(path.join(prefixDir, "bin", "codex"), "#!/bin/sh\nexit 0\n", "utf8");
fs.chmodSync(path.join(prefixDir, "bin", "codex"), 0o755);
fs.writeFileSync(preferredCodexPath, "#!/bin/sh\nexit 0\n", "utf8");
fs.chmodSync(preferredCodexPath, 0o755);
process.env.HOME = tempHomeDir;
process.env.PATH = "/usr/bin:/bin";

spawnMock.mockImplementation((command: string, args: string[] = []) => {
if (args[0] === "--version") {
if (command === "codex") return fakeError();
if (command === path.join(prefixDir, "bin", "codex")) return fakeChild({ status: 0, stdout: "0.105.0\n" });
return fakeError();
const realStatSync = fs.statSync.bind(fs);
const statSpy = vi.spyOn(fs, "statSync").mockImplementation(((candidatePath: fs.PathLike, options?: fs.StatOptions) => {
const resolved = String(candidatePath);
if (resolved.endsWith("/codex") && resolved !== preferredCodexPath) {
const error = new Error(`ENOENT: no such file or directory, stat '${resolved}'`) as NodeJS.ErrnoException;
error.code = "ENOENT";
throw error;
}
if (command === "which") {
return realStatSync(candidatePath, options as fs.StatOptions | undefined);
}) as typeof fs.statSync);

try {
spawnMock.mockImplementation((command: string, args: string[] = []) => {
if (args[0] === "--version") {
if (command === "codex") return fakeError();
if (command === preferredCodexPath) return fakeChild({ status: 0, stdout: "0.105.0\n" });
return fakeError();
}
if (command === "which") {
return fakeChild({ status: 1 });
}
if ((command === "codex" || command.endsWith("/codex")) && args[0] === "login" && args[1] === "status") {
return fakeChild({ status: 0, stdout: "Authenticated as test-user\n" });
}
return fakeChild({ status: 1 });
}
if ((command === "codex" || command.endsWith("/codex")) && args[0] === "login" && args[1] === "status") {
return fakeChild({ status: 0, stdout: "Authenticated as test-user\n" });
}
return fakeChild({ status: 1 });
});
});

const statuses = await detectCliAuthStatuses();
const codex = statuses.find((entry) => entry.cli === "codex");
const statuses = await detectCliAuthStatuses();
const codex = statuses.find((entry) => entry.cli === "codex");

expect(codex).toEqual({
cli: "codex",
installed: true,
path: path.join(prefixDir, "bin", "codex"),
authenticated: true,
verified: true,
});
expect(codex).toEqual({
cli: "codex",
installed: true,
path: preferredCodexPath,
authenticated: true,
verified: true,
});
} finally {
statSpy.mockRestore();
}
});

it("repairs PATH from the interactive shell during a forced refresh", async () => {
Expand Down
Loading
Loading