@golba98/codexa 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +391 -94
- package/package.json +12 -7
- package/src/app.tsx +149 -117
- package/src/commands/handler.ts +4 -4
- package/src/config/buildInfo.ts +2 -2
- package/src/config/persistence.ts +10 -0
- package/src/config/settings.ts +7 -15
- package/src/config/updateCheckCache.ts +19 -1
- package/src/core/channel.ts +23 -0
- package/src/core/executables/codexExecutable.ts +1 -0
- package/src/core/executables/executableResolver.ts +61 -43
- package/src/core/launchContext.ts +33 -33
- package/src/core/process/processValidation.ts +9 -5
- package/src/core/providerLauncher/launcher.ts +59 -42
- package/src/core/updateCheck.ts +111 -95
- package/src/session/types.ts +2 -1
- package/src/ui/ActionRequiredBlock.tsx +5 -5
- package/src/ui/ActivityBars.tsx +3 -3
- package/src/ui/ActivityIndicator.tsx +6 -6
- package/src/ui/AgentBlock.tsx +6 -6
- package/src/ui/AnimatedStatusText.tsx +1 -1
- package/src/ui/AppShell.tsx +9 -24
- package/src/ui/AttachmentImportPanel.tsx +8 -8
- package/src/ui/AuthPanel.tsx +20 -20
- package/src/ui/BottomComposer.tsx +117 -78
- package/src/ui/DashCard.tsx +3 -3
- package/src/ui/Markdown.tsx +17 -17
- package/src/ui/ModelPickerScreen.tsx +10 -10
- package/src/ui/ModelReasoningPicker.tsx +14 -14
- package/src/ui/Panel.tsx +3 -3
- package/src/ui/PlanActionPicker.tsx +6 -6
- package/src/ui/PlanReviewPanel.tsx +8 -8
- package/src/ui/ProviderPicker.tsx +18 -18
- package/src/ui/RunFooter.tsx +3 -3
- package/src/ui/SelectionPanel.tsx +4 -4
- package/src/ui/SettingsPanel.tsx +8 -8
- package/src/ui/Spinner.tsx +1 -1
- package/src/ui/TextEntryPanel.tsx +10 -10
- package/src/ui/ThinkingBlock.tsx +8 -8
- package/src/ui/Timeline.tsx +21 -17
- package/src/ui/TopHeader.tsx +421 -293
- package/src/ui/TurnGroup.tsx +31 -31
- package/src/ui/UpdateAvailableCard.tsx +41 -0
- package/src/ui/UpdatePromptPanel.tsx +203 -0
- package/src/ui/focus.ts +3 -0
- package/src/ui/layout.ts +1 -1
- package/src/ui/logoVariants.ts +107 -0
- package/src/ui/modeDisplay.ts +12 -12
- package/src/ui/runtimeDisplay.ts +100 -0
- package/src/ui/theme.tsx +274 -395
- package/src/ui/timelineMeasure.ts +29 -19
- package/scripts/audit-codexa-capabilities.mjs +0 -466
- package/scripts/gen-build-info.mjs +0 -33
- package/scripts/smoke-terminal-bench.mjs +0 -35
- package/src/appRenderStability.test.ts +0 -131
- package/src/commands/handler.test.ts +0 -655
- package/src/config/launchArgs.test.ts +0 -189
- package/src/config/layeredConfig.test.ts +0 -143
- package/src/config/persistence.test.ts +0 -114
- package/src/config/runtimeConfig.test.ts +0 -218
- package/src/config/settings.test.ts +0 -155
- package/src/config/trustStore.test.ts +0 -29
- package/src/core/attachments.test.ts +0 -155
- package/src/core/auth/codexAuth.test.ts +0 -68
- package/src/core/cleanupFastFail.test.ts +0 -76
- package/src/core/codexExecArgs.test.ts +0 -195
- package/src/core/codexLaunch.test.ts +0 -205
- package/src/core/codexPrompt.test.ts +0 -252
- package/src/core/executables/codexExecutable.test.ts +0 -212
- package/src/core/executables/executableResolver.test.ts +0 -129
- package/src/core/executables/geminiExecutable.test.ts +0 -116
- package/src/core/executables/pathSanityScan.test.ts +0 -47
- package/src/core/githubDiagnostics.test.ts +0 -92
- package/src/core/hollowResponseFormat.test.ts +0 -58
- package/src/core/launchContext.test.ts +0 -157
- package/src/core/models/codexCapabilities.test.ts +0 -45
- package/src/core/models/codexModelCapabilities.test.ts +0 -246
- package/src/core/models/modelSpecs.test.ts +0 -283
- package/src/core/perf/renderDebug.test.ts +0 -230
- package/src/core/planStorage.test.ts +0 -143
- package/src/core/process/CommandRunner.test.ts +0 -105
- package/src/core/projectInstructions.test.ts +0 -50
- package/src/core/providerLauncher/launcher.test.ts +0 -238
- package/src/core/providerLauncher/registry.test.ts +0 -324
- package/src/core/providerLauncher/workspaceConfig.test.ts +0 -638
- package/src/core/providerRuntime/anthropic.test.ts +0 -1120
- package/src/core/providerRuntime/capabilityProfile.test.ts +0 -311
- package/src/core/providerRuntime/contextMetadata.test.ts +0 -468
- package/src/core/providerRuntime/gemini.test.ts +0 -437
- package/src/core/providerRuntime/lmstudio.test.ts +0 -168
- package/src/core/providerRuntime/local.test.ts +0 -787
- package/src/core/providerRuntime/registry.test.ts +0 -233
- package/src/core/providers/codexJsonStream.test.ts +0 -148
- package/src/core/providers/codexSubprocess.test.ts +0 -68
- package/src/core/providers/codexTranscript.test.ts +0 -284
- package/src/core/terminal/startupClear.test.ts +0 -55
- package/src/core/terminal/terminalCapabilities.test.ts +0 -93
- package/src/core/terminal/terminalControl.test.ts +0 -75
- package/src/core/terminal/terminalSanitize.test.ts +0 -22
- package/src/core/terminal/terminalSelection.test.ts +0 -42
- package/src/core/terminal/terminalTitle.test.ts +0 -328
- package/src/core/updateCheck.test.ts +0 -194
- package/src/core/workspaceActivity.test.ts +0 -163
- package/src/core/workspaceGuard.test.ts +0 -151
- package/src/core/workspaceRoot.test.ts +0 -23
- package/src/exec.test.ts +0 -13
- package/src/headless/execArgs.test.ts +0 -147
- package/src/headless/execRunner.test.ts +0 -436
- package/src/index.test.tsx +0 -620
- package/src/session/appSession.test.ts +0 -897
- package/src/session/chatLifecycle.test.ts +0 -64
- package/src/session/liveRenderScheduler.test.ts +0 -201
- package/src/session/planFlow.test.ts +0 -103
- package/src/session/planTranscript.test.ts +0 -65
- package/src/session/promptRunSchedule.test.ts +0 -36
- package/src/ui/ActivityIndicator.test.tsx +0 -58
- package/src/ui/AgentBlock.test.ts +0 -6
- package/src/ui/AnimatedStatusText.test.ts +0 -16
- package/src/ui/AppShell.test.tsx +0 -1776
- package/src/ui/AttachmentImportPanel.test.tsx +0 -204
- package/src/ui/BottomComposer.test.ts +0 -674
- package/src/ui/CodexLogo.tsx +0 -55
- package/src/ui/Markdown.test.ts +0 -157
- package/src/ui/ModelPickerProviderScope.test.tsx +0 -411
- package/src/ui/ModelPickerScreen.test.tsx +0 -99
- package/src/ui/ModelPickerState.test.tsx +0 -151
- package/src/ui/ModelReasoningPicker.test.tsx +0 -447
- package/src/ui/PlanReviewPanel.test.tsx +0 -267
- package/src/ui/PromptCardBorder.test.tsx +0 -161
- package/src/ui/ProviderPicker.test.tsx +0 -289
- package/src/ui/ProviderShortcut.test.tsx +0 -143
- package/src/ui/SettingsPanel.test.tsx +0 -233
- package/src/ui/Timeline.test.ts +0 -2067
- package/src/ui/TimelineNavigation.test.tsx +0 -201
- package/src/ui/TopHeader.test.tsx +0 -254
- package/src/ui/TurnGroup.test.tsx +0 -365
- package/src/ui/busyStatusAnimation.test.ts +0 -30
- package/src/ui/commandNormalize.test.ts +0 -142
- package/src/ui/diffRenderer.test.ts +0 -102
- package/src/ui/focusFlow.test.tsx +0 -1098
- package/src/ui/inputBuffer.test.ts +0 -151
- package/src/ui/layout.test.ts +0 -146
- package/src/ui/modeDisplay.test.ts +0 -42
- package/src/ui/runActivityView.test.ts +0 -89
- package/src/ui/runLifecycleView.test.tsx +0 -237
- package/src/ui/statusRenderIsolation.test.tsx +0 -654
- package/src/ui/terminalAnswerFormat.test.ts +0 -19
- package/src/ui/textLayout.test.ts +0 -18
- package/src/ui/themeFlow.test.ts +0 -53
- package/src/ui/timelineMeasureCache.test.ts +0 -986
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
containsDirectoryNavigationCommand,
|
|
5
|
-
findOutsideWorkspacePaths,
|
|
6
|
-
getPromptWorkspaceGuardMessage,
|
|
7
|
-
getShellWorkspaceGuardMessage,
|
|
8
|
-
isPathInsideAllowedRoots,
|
|
9
|
-
isPathInsideWorkspace,
|
|
10
|
-
resolveWorkspacePath,
|
|
11
|
-
} from "./workspaceGuard.js";
|
|
12
|
-
import { normalizeWorkspaceRoot } from "./workspaceRoot.js";
|
|
13
|
-
|
|
14
|
-
const workspaceRoot = normalizeWorkspaceRoot("C:/Users/Example/OneDrive/Desktop/3-Python/Programs/2-Personal/20-Tester");
|
|
15
|
-
|
|
16
|
-
test("allows absolute paths inside the locked workspace", () => {
|
|
17
|
-
const violations = findOutsideWorkspacePaths(
|
|
18
|
-
"Please update C:\\Users\\Example\\OneDrive\\Desktop\\3-Python\\Programs\\2-Personal\\20-Tester\\src\\main.py",
|
|
19
|
-
workspaceRoot,
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
assert.deepEqual(violations, []);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
test("blocks absolute paths outside the locked workspace", () => {
|
|
26
|
-
const violations = findOutsideWorkspacePaths(
|
|
27
|
-
"Please edit C:\\Users\\Example\\Desktop\\Other\\notes.txt",
|
|
28
|
-
workspaceRoot,
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
assert.equal(violations.length, 1);
|
|
32
|
-
assert.equal(
|
|
33
|
-
violations[0]?.normalizedPath,
|
|
34
|
-
"C:\\Users\\Example\\Desktop\\Other\\notes.txt",
|
|
35
|
-
);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
test("parses quoted windows paths with spaces", () => {
|
|
39
|
-
const violations = findOutsideWorkspacePaths(
|
|
40
|
-
"Use \"C:\\Users\\Example\\Desktop\\Other Folder\\notes file.txt\" instead",
|
|
41
|
-
workspaceRoot,
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
assert.equal(violations.length, 1);
|
|
45
|
-
assert.equal(
|
|
46
|
-
violations[0]?.normalizedPath,
|
|
47
|
-
"C:\\Users\\Example\\Desktop\\Other Folder\\notes file.txt",
|
|
48
|
-
);
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
test("resolves relative paths inside the workspace", () => {
|
|
52
|
-
assert.equal(
|
|
53
|
-
resolveWorkspacePath("src\\main.py", workspaceRoot),
|
|
54
|
-
"C:\\Users\\Example\\OneDrive\\Desktop\\3-Python\\Programs\\2-Personal\\20-Tester\\src\\main.py",
|
|
55
|
-
);
|
|
56
|
-
assert.equal(isPathInsideWorkspace("src\\main.py", workspaceRoot), true);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
test("blocks explicit relative paths that escape the workspace", () => {
|
|
60
|
-
const violations = findOutsideWorkspacePaths("Edit ..\\outside.txt", workspaceRoot);
|
|
61
|
-
|
|
62
|
-
assert.equal(violations.length, 1);
|
|
63
|
-
assert.equal(
|
|
64
|
-
violations[0]?.normalizedPath,
|
|
65
|
-
"C:\\Users\\Example\\OneDrive\\Desktop\\3-Python\\Programs\\2-Personal\\outside.txt",
|
|
66
|
-
);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
test("treats same-path drive letter case differences as inside the workspace", () => {
|
|
70
|
-
assert.equal(
|
|
71
|
-
isPathInsideWorkspace(
|
|
72
|
-
"c:\\users\\Example\\onedrive\\desktop\\3-python\\programs\\2-personal\\20-tester\\src\\main.py",
|
|
73
|
-
workspaceRoot,
|
|
74
|
-
),
|
|
75
|
-
true,
|
|
76
|
-
);
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
test("allows configured writable roots outside the locked workspace", () => {
|
|
80
|
-
const extraRoot = "C:\\Users\\Example\\Desktop\\Allowed Root";
|
|
81
|
-
|
|
82
|
-
assert.equal(
|
|
83
|
-
isPathInsideAllowedRoots("C:\\Users\\Example\\Desktop\\Allowed Root\\notes.txt", workspaceRoot, [extraRoot]),
|
|
84
|
-
true,
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
const promptMessage = getPromptWorkspaceGuardMessage(
|
|
88
|
-
"Edit \"C:\\Users\\Example\\Desktop\\Allowed Root\\notes.txt\"",
|
|
89
|
-
workspaceRoot,
|
|
90
|
-
[extraRoot],
|
|
91
|
-
);
|
|
92
|
-
assert.equal(promptMessage, null);
|
|
93
|
-
|
|
94
|
-
const shellMessage = getShellWorkspaceGuardMessage(
|
|
95
|
-
"type \"C:\\Users\\Example\\Desktop\\Allowed Root\\notes.txt\"",
|
|
96
|
-
workspaceRoot,
|
|
97
|
-
[extraRoot],
|
|
98
|
-
);
|
|
99
|
-
assert.equal(shellMessage, null);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
test("still blocks paths outside the workspace and configured writable roots", () => {
|
|
103
|
-
const extraRoot = "C:\\Users\\Example\\Desktop\\Allowed Root";
|
|
104
|
-
const message = getPromptWorkspaceGuardMessage(
|
|
105
|
-
"Edit C:\\Users\\Example\\Desktop\\Other\\notes.txt",
|
|
106
|
-
workspaceRoot,
|
|
107
|
-
[extraRoot],
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
assert(message);
|
|
111
|
-
assert.match(message, /Allowed writable roots:/i);
|
|
112
|
-
assert.match(message, /Allowed Root/i);
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
test("returns a prompt guard message before a run starts", () => {
|
|
116
|
-
const message = getPromptWorkspaceGuardMessage(
|
|
117
|
-
"Edit C:\\Users\\Example\\Desktop\\Other\\notes.txt",
|
|
118
|
-
workspaceRoot,
|
|
119
|
-
);
|
|
120
|
-
|
|
121
|
-
assert(message);
|
|
122
|
-
assert.match(message, /Run blocked/i);
|
|
123
|
-
assert.match(message, /Locked workspace:/i);
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
test("blocks directory-changing shell commands", () => {
|
|
127
|
-
assert.equal(containsDirectoryNavigationCommand("cd .."), true);
|
|
128
|
-
assert.equal(containsDirectoryNavigationCommand("Set-Location .."), true);
|
|
129
|
-
assert.equal(containsDirectoryNavigationCommand("pushd .."), true);
|
|
130
|
-
|
|
131
|
-
const message = getShellWorkspaceGuardMessage("cd ..", workspaceRoot);
|
|
132
|
-
assert(message);
|
|
133
|
-
assert.match(message, /Directory-changing commands/i);
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
test("blocks shell commands that reference outside absolute paths", () => {
|
|
137
|
-
const message = getShellWorkspaceGuardMessage(
|
|
138
|
-
"type C:\\Users\\Example\\Desktop\\Other\\notes.txt",
|
|
139
|
-
workspaceRoot,
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
assert(message);
|
|
143
|
-
assert.match(message, /Outside path references:/i);
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
test("blocks shell commands that reference escaping relative paths", () => {
|
|
147
|
-
const message = getShellWorkspaceGuardMessage("type ..\\outside.txt", workspaceRoot);
|
|
148
|
-
|
|
149
|
-
assert(message);
|
|
150
|
-
assert.match(message, /Outside path references:/i);
|
|
151
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import test from "node:test";
|
|
3
|
-
import { normalizeWorkspaceRoot, resolveWorkspaceRoot } from "./workspaceRoot.js";
|
|
4
|
-
|
|
5
|
-
test("prefers CODEX_WORKSPACE_ROOT when provided", () => {
|
|
6
|
-
const originalWorkspace = process.env.CODEX_WORKSPACE_ROOT;
|
|
7
|
-
try {
|
|
8
|
-
process.env.CODEX_WORKSPACE_ROOT = "D:/project/";
|
|
9
|
-
assert.equal(resolveWorkspaceRoot(), normalizeWorkspaceRoot("D:/project/"));
|
|
10
|
-
} finally {
|
|
11
|
-
process.env.CODEX_WORKSPACE_ROOT = originalWorkspace;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
test("falls back to process.cwd when no workspace override exists", () => {
|
|
16
|
-
const originalWorkspace = process.env.CODEX_WORKSPACE_ROOT;
|
|
17
|
-
try {
|
|
18
|
-
delete process.env.CODEX_WORKSPACE_ROOT;
|
|
19
|
-
assert.equal(resolveWorkspaceRoot(), normalizeWorkspaceRoot(process.cwd()));
|
|
20
|
-
} finally {
|
|
21
|
-
process.env.CODEX_WORKSPACE_ROOT = originalWorkspace;
|
|
22
|
-
}
|
|
23
|
-
});
|
package/src/exec.test.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import test from "node:test";
|
|
5
|
-
|
|
6
|
-
test("codexa exec entrypoint does not import interactive UI modules", () => {
|
|
7
|
-
const source = readFileSync(fileURLToPath(new URL("./exec.ts", import.meta.url)), "utf8");
|
|
8
|
-
|
|
9
|
-
assert.doesNotMatch(source, /from\s+["']\.\/index(?:\.js)?["']/);
|
|
10
|
-
assert.doesNotMatch(source, /from\s+["']\.\/app(?:\.js)?["']/);
|
|
11
|
-
assert.doesNotMatch(source, /from\s+["']ink["']/);
|
|
12
|
-
assert.doesNotMatch(source, /from\s+["']react["']/);
|
|
13
|
-
});
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import assert from "node:assert/strict";
|
|
2
|
-
import test from "node:test";
|
|
3
|
-
import { parseHeadlessExecArgs } from "./execArgs.js";
|
|
4
|
-
|
|
5
|
-
test("parses codexa exec positional prompt", () => {
|
|
6
|
-
const parsed = parseHeadlessExecArgs(["Print", "the", "directory"]);
|
|
7
|
-
|
|
8
|
-
assert.equal(parsed.ok, true);
|
|
9
|
-
if (!parsed.ok) return;
|
|
10
|
-
assert.equal(parsed.value.prompt, "Print the directory");
|
|
11
|
-
assert.equal(parsed.value.promptPolicy, "raw");
|
|
12
|
-
assert.equal(parsed.value.launchArgs.initialPrompt, "Print the directory");
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
test("parses codexa exec --prompt value", () => {
|
|
16
|
-
const parsed = parseHeadlessExecArgs(["--prompt", "Print the directory"]);
|
|
17
|
-
|
|
18
|
-
assert.equal(parsed.ok, true);
|
|
19
|
-
if (!parsed.ok) return;
|
|
20
|
-
assert.equal(parsed.value.prompt, "Print the directory");
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
test("parses codexa exec --prompt=value", () => {
|
|
24
|
-
const parsed = parseHeadlessExecArgs(["--prompt=Print the directory"]);
|
|
25
|
-
|
|
26
|
-
assert.equal(parsed.ok, true);
|
|
27
|
-
if (!parsed.ok) return;
|
|
28
|
-
assert.equal(parsed.value.prompt, "Print the directory");
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
test("rejects missing and empty prompts", () => {
|
|
32
|
-
const missing = parseHeadlessExecArgs([]);
|
|
33
|
-
assert.equal(missing.ok, false);
|
|
34
|
-
if (!missing.ok) {
|
|
35
|
-
assert.match(missing.error, /missing prompt/i);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const empty = parseHeadlessExecArgs(["--prompt", " "]);
|
|
39
|
-
assert.equal(empty.ok, false);
|
|
40
|
-
if (!empty.ok) {
|
|
41
|
-
assert.match(empty.error, /--prompt/i);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
test("parses codexa exec --reasoning value", () => {
|
|
46
|
-
const parsed = parseHeadlessExecArgs(["--reasoning", "medium", "Print files"]);
|
|
47
|
-
|
|
48
|
-
assert.equal(parsed.ok, true);
|
|
49
|
-
if (!parsed.ok) return;
|
|
50
|
-
assert.equal(parsed.value.prompt, "Print files");
|
|
51
|
-
assert.deepEqual(parsed.value.launchArgs.configOverrides, ["model_reasoning_effort=medium"]);
|
|
52
|
-
assert.deepEqual(parsed.value.launchArgs.passthroughArgs, ["--reasoning", "medium"]);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
test("parses codexa exec --reasoning=value", () => {
|
|
56
|
-
const parsed = parseHeadlessExecArgs(["--reasoning=high", "Print files"]);
|
|
57
|
-
|
|
58
|
-
assert.equal(parsed.ok, true);
|
|
59
|
-
if (!parsed.ok) return;
|
|
60
|
-
assert.equal(parsed.value.prompt, "Print files");
|
|
61
|
-
assert.deepEqual(parsed.value.launchArgs.configOverrides, ["model_reasoning_effort=high"]);
|
|
62
|
-
assert.deepEqual(parsed.value.launchArgs.passthroughArgs, ["--reasoning=high"]);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
test("parses timing and prompt policy flags without forwarding them to Codex", () => {
|
|
66
|
-
const parsed = parseHeadlessExecArgs([
|
|
67
|
-
"--timing",
|
|
68
|
-
"--codexa-prompt-policy",
|
|
69
|
-
"wrapped",
|
|
70
|
-
"Print files",
|
|
71
|
-
]);
|
|
72
|
-
|
|
73
|
-
assert.equal(parsed.ok, true);
|
|
74
|
-
if (!parsed.ok) return;
|
|
75
|
-
assert.equal(parsed.value.timing, true);
|
|
76
|
-
assert.equal(parsed.value.promptPolicy, "wrapped");
|
|
77
|
-
assert.equal(parsed.value.prompt, "Print files");
|
|
78
|
-
assert.deepEqual(parsed.value.launchArgs.passthroughArgs, []);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
test("rejects invalid prompt policy values", () => {
|
|
82
|
-
const parsed = parseHeadlessExecArgs(["--codexa-prompt-policy", "verbose", "Prompt"]);
|
|
83
|
-
|
|
84
|
-
assert.equal(parsed.ok, false);
|
|
85
|
-
if (!parsed.ok) {
|
|
86
|
-
assert.match(parsed.error, /codexa-prompt-policy/i);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
test("parses codexa exec --model and --reasoning together", () => {
|
|
91
|
-
const parsed = parseHeadlessExecArgs([
|
|
92
|
-
"--model", "gpt-5.4-mini",
|
|
93
|
-
"--reasoning", "medium",
|
|
94
|
-
"Reply with exactly: CODEXA_READY",
|
|
95
|
-
]);
|
|
96
|
-
|
|
97
|
-
assert.equal(parsed.ok, true);
|
|
98
|
-
if (!parsed.ok) return;
|
|
99
|
-
assert.equal(parsed.value.prompt, "Reply with exactly: CODEXA_READY");
|
|
100
|
-
assert.deepEqual(parsed.value.launchArgs.configOverrides, [
|
|
101
|
-
"model=\"gpt-5.4-mini\"",
|
|
102
|
-
"model_reasoning_effort=medium",
|
|
103
|
-
]);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
test("preserves profile and repeated config overrides", () => {
|
|
107
|
-
const parsed = parseHeadlessExecArgs([
|
|
108
|
-
"--benchmark-diagnostics",
|
|
109
|
-
"--skip-git-repo-check",
|
|
110
|
-
"--profile",
|
|
111
|
-
"bench",
|
|
112
|
-
"--model",
|
|
113
|
-
"gpt-5.4-mini",
|
|
114
|
-
"-c",
|
|
115
|
-
"model_reasoning_effort=medium",
|
|
116
|
-
"--config",
|
|
117
|
-
"sandbox_mode=\"workspace-write\"",
|
|
118
|
-
"--config=approval_policy=\"never\"",
|
|
119
|
-
"Print",
|
|
120
|
-
"files",
|
|
121
|
-
]);
|
|
122
|
-
|
|
123
|
-
assert.equal(parsed.ok, true);
|
|
124
|
-
if (!parsed.ok) return;
|
|
125
|
-
assert.equal(parsed.value.benchmarkDiagnostics, true);
|
|
126
|
-
assert.equal(parsed.value.timing, true);
|
|
127
|
-
assert.equal(parsed.value.prompt, "Print files");
|
|
128
|
-
assert.equal(parsed.value.launchArgs.profile, "bench");
|
|
129
|
-
assert.deepEqual(parsed.value.launchArgs.configOverrides, [
|
|
130
|
-
"model=\"gpt-5.4-mini\"",
|
|
131
|
-
"model_reasoning_effort=medium",
|
|
132
|
-
"sandbox_mode=\"workspace-write\"",
|
|
133
|
-
"approval_policy=\"never\"",
|
|
134
|
-
]);
|
|
135
|
-
assert.deepEqual(parsed.value.launchArgs.passthroughArgs, [
|
|
136
|
-
"--skip-git-repo-check",
|
|
137
|
-
"--profile",
|
|
138
|
-
"bench",
|
|
139
|
-
"--model",
|
|
140
|
-
"gpt-5.4-mini",
|
|
141
|
-
"-c",
|
|
142
|
-
"model_reasoning_effort=medium",
|
|
143
|
-
"--config",
|
|
144
|
-
"sandbox_mode=\"workspace-write\"",
|
|
145
|
-
"--config=approval_policy=\"never\"",
|
|
146
|
-
]);
|
|
147
|
-
});
|