@agentbean/daemon 0.1.5 → 0.1.7
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/dist/adapters/codex.js +10 -1
- package/package.json +1 -1
package/dist/adapters/codex.js
CHANGED
|
@@ -27,6 +27,14 @@ function extractReply(output) {
|
|
|
27
27
|
}
|
|
28
28
|
return clean.trim();
|
|
29
29
|
}
|
|
30
|
+
function normalizeExecArgs(args) {
|
|
31
|
+
const baseArgs = args && args.length > 0 ? args : ['exec'];
|
|
32
|
+
const subcommand = baseArgs[0];
|
|
33
|
+
if ((subcommand === 'exec' || subcommand === 'e') && !baseArgs.includes('--skip-git-repo-check')) {
|
|
34
|
+
return [subcommand, '--skip-git-repo-check', ...baseArgs.slice(1)];
|
|
35
|
+
}
|
|
36
|
+
return baseArgs;
|
|
37
|
+
}
|
|
30
38
|
export class CodexAdapter {
|
|
31
39
|
opts;
|
|
32
40
|
kind = 'codex';
|
|
@@ -38,7 +46,8 @@ export class CodexAdapter {
|
|
|
38
46
|
const payload = renderPayload(input, this.opts.systemPrompt ?? input.systemPrompt);
|
|
39
47
|
const cwd = input.workspace ?? this.opts.cwd ?? process.cwd();
|
|
40
48
|
const baseCommand = this.opts.command || 'codex';
|
|
41
|
-
const
|
|
49
|
+
const configuredArgs = normalizeExecArgs(this.opts.args);
|
|
50
|
+
const baseArgs = [...configuredArgs, payload];
|
|
42
51
|
const command = input.sandboxProfilePath ? 'sandbox-exec' : baseCommand;
|
|
43
52
|
const args = input.sandboxProfilePath
|
|
44
53
|
? ['-f', input.sandboxProfilePath, '--', baseCommand, ...baseArgs]
|