polydev-ai 1.10.14 → 1.10.16
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/lib/cliManager.js +81 -69
- package/package.json +1 -1
package/lib/cliManager.js
CHANGED
|
@@ -56,7 +56,7 @@ class CLIManager {
|
|
|
56
56
|
chat: [],
|
|
57
57
|
version: ['--version'],
|
|
58
58
|
auth_status: ['--print', 'test auth'], // Use --print to test auth
|
|
59
|
-
test_prompt: ['--print', '--output-format', 'json'] //
|
|
59
|
+
test_prompt: ['--print', '--output-format', 'json', '--max-turns', '3'] // JSON output, limit agentic loops
|
|
60
60
|
},
|
|
61
61
|
install_instructions: 'Install via: npm install -g @anthropic-ai/claude-code',
|
|
62
62
|
auth_instructions: 'Authenticate with Claude Code'
|
|
@@ -846,29 +846,33 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
846
846
|
// Explicitly pass environment to ensure HOME is available for CLI tools
|
|
847
847
|
// that read config from ~/.config or similar paths (e.g., Gemini CLI)
|
|
848
848
|
// Also include flags to suppress update prompts and browser opening
|
|
849
|
-
env: {
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
849
|
+
env: (() => {
|
|
850
|
+
const env = {
|
|
851
|
+
...process.env,
|
|
852
|
+
HOME: process.env.HOME || os.homedir(),
|
|
853
|
+
// Suppress interactive prompts and update checks
|
|
854
|
+
NO_COLOR: '1',
|
|
855
|
+
TERM: 'dumb',
|
|
856
|
+
NONINTERACTIVE: '1',
|
|
857
|
+
// Prevent browser opening (OAuth, updates, etc.)
|
|
858
|
+
NO_BROWSER: '1',
|
|
859
|
+
BROWSER: 'echo', // Redirect browser opening to no-op
|
|
860
|
+
DISPLAY: '', // Prevent X11 browser opening
|
|
861
|
+
HEADLESS: '1',
|
|
862
|
+
// CLI-specific flags to suppress updates
|
|
863
|
+
CODEX_DISABLE_UPDATE_CHECK: '1',
|
|
864
|
+
CLAUDE_CODE_DISABLE_UPDATE_CHECK: '1',
|
|
865
|
+
GEMINI_NO_BROWSER: '1',
|
|
866
|
+
GOOGLE_NO_BROWSER: '1',
|
|
867
|
+
// Prevent package manager update prompts
|
|
868
|
+
npm_config_update_notifier: 'false',
|
|
869
|
+
NO_UPDATE_NOTIFIER: '1'
|
|
870
|
+
};
|
|
871
|
+
// Fully remove ANTHROPIC_API_KEY — empty string still triggers
|
|
872
|
+
// Claude CLI's "Invalid API key" error (GitHub #8327)
|
|
873
|
+
delete env.ANTHROPIC_API_KEY;
|
|
874
|
+
return env;
|
|
875
|
+
})()
|
|
872
876
|
});
|
|
873
877
|
|
|
874
878
|
if (child.stdin) {
|
|
@@ -1154,29 +1158,33 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
1154
1158
|
const child = spawn(executable, args, {
|
|
1155
1159
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
1156
1160
|
shell: process.platform === 'win32',
|
|
1157
|
-
env: {
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1161
|
+
env: (() => {
|
|
1162
|
+
const env = {
|
|
1163
|
+
...process.env,
|
|
1164
|
+
TMPDIR: tmpDir,
|
|
1165
|
+
TEMP: tmpDir,
|
|
1166
|
+
TMP: tmpDir,
|
|
1167
|
+
HOME: process.env.HOME || os.homedir(),
|
|
1168
|
+
// Suppress interactive prompts and update checks
|
|
1169
|
+
NO_COLOR: '1',
|
|
1170
|
+
TERM: 'dumb',
|
|
1171
|
+
NONINTERACTIVE: '1',
|
|
1172
|
+
// Prevent browser opening (OAuth, updates, etc.)
|
|
1173
|
+
NO_BROWSER: '1',
|
|
1174
|
+
BROWSER: 'echo',
|
|
1175
|
+
DISPLAY: '',
|
|
1176
|
+
HEADLESS: '1',
|
|
1177
|
+
// CLI-specific flags to suppress updates
|
|
1178
|
+
CODEX_DISABLE_UPDATE_CHECK: '1',
|
|
1179
|
+
// Prevent package manager update prompts
|
|
1180
|
+
npm_config_update_notifier: 'false',
|
|
1181
|
+
NO_UPDATE_NOTIFIER: '1'
|
|
1182
|
+
};
|
|
1183
|
+
// Fully remove ANTHROPIC_API_KEY — empty string still triggers
|
|
1184
|
+
// Claude CLI's "Invalid API key" error (GitHub #8327)
|
|
1185
|
+
delete env.ANTHROPIC_API_KEY;
|
|
1186
|
+
return env;
|
|
1187
|
+
})()
|
|
1180
1188
|
});
|
|
1181
1189
|
|
|
1182
1190
|
console.log(`[CLI Debug] Spawning Codex process: ${executable} ${args.join(' ')}`);
|
|
@@ -1421,7 +1429,7 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
1421
1429
|
*/
|
|
1422
1430
|
buildStreamingArgs(providerId, prompt, model = null) {
|
|
1423
1431
|
if (providerId === 'claude_code') {
|
|
1424
|
-
const args = ['-p', '--output-format', 'stream-json', '--verbose', '--include-partial-messages'];
|
|
1432
|
+
const args = ['-p', '--output-format', 'stream-json', '--verbose', '--include-partial-messages', '--max-turns', '3'];
|
|
1425
1433
|
|
|
1426
1434
|
// Add model flag if specified
|
|
1427
1435
|
if (model) {
|
|
@@ -1486,27 +1494,31 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
1486
1494
|
const child = spawn(provider.command, args, {
|
|
1487
1495
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
1488
1496
|
shell: process.platform === 'win32',
|
|
1489
|
-
env: {
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1497
|
+
env: (() => {
|
|
1498
|
+
const env = {
|
|
1499
|
+
...process.env,
|
|
1500
|
+
HOME: process.env.HOME || os.homedir(),
|
|
1501
|
+
// Suppress interactive prompts and update checks
|
|
1502
|
+
NO_COLOR: '1',
|
|
1503
|
+
TERM: 'dumb',
|
|
1504
|
+
NONINTERACTIVE: '1',
|
|
1505
|
+
// Prevent browser opening (OAuth, updates, etc.)
|
|
1506
|
+
NO_BROWSER: '1',
|
|
1507
|
+
BROWSER: 'echo',
|
|
1508
|
+
DISPLAY: '',
|
|
1509
|
+
HEADLESS: '1',
|
|
1510
|
+
CODEX_DISABLE_UPDATE_CHECK: '1',
|
|
1511
|
+
CLAUDE_CODE_DISABLE_UPDATE_CHECK: '1',
|
|
1512
|
+
GEMINI_NO_BROWSER: '1',
|
|
1513
|
+
GOOGLE_NO_BROWSER: '1',
|
|
1514
|
+
npm_config_update_notifier: 'false',
|
|
1515
|
+
NO_UPDATE_NOTIFIER: '1'
|
|
1516
|
+
};
|
|
1517
|
+
// Fully remove ANTHROPIC_API_KEY — empty string still triggers
|
|
1518
|
+
// Claude CLI's "Invalid API key" error (GitHub #8327)
|
|
1519
|
+
delete env.ANTHROPIC_API_KEY;
|
|
1520
|
+
return env;
|
|
1521
|
+
})()
|
|
1510
1522
|
});
|
|
1511
1523
|
|
|
1512
1524
|
// Close stdin immediately to prevent hanging (critical for Gemini CLI)
|