polydev-ai 1.10.17 → 1.10.19
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 +8 -3
- package/mcp/stdio-wrapper.js +12 -5
- package/package.json +1 -1
package/lib/cliManager.js
CHANGED
|
@@ -1136,14 +1136,16 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
1136
1136
|
console.log(`[CLI Debug] Codex using model: ${model}`);
|
|
1137
1137
|
}
|
|
1138
1138
|
|
|
1139
|
-
// Add standard flags and prompt
|
|
1139
|
+
// Add standard flags and direct-answer prompt
|
|
1140
|
+
// Prefix prevents Codex from doing agentic file/exec operations — just answer the question
|
|
1141
|
+
const directPrompt = `Answer this question directly from your knowledge. Do not execute any commands, read any files, or use any tools. Provide a concise, expert response.\n\n${prompt}`;
|
|
1140
1142
|
args.push(
|
|
1141
1143
|
'--full-auto',
|
|
1142
1144
|
'--ephemeral',
|
|
1143
1145
|
'--skip-git-repo-check',
|
|
1144
1146
|
'--cd',
|
|
1145
1147
|
workingDir,
|
|
1146
|
-
|
|
1148
|
+
directPrompt
|
|
1147
1149
|
);
|
|
1148
1150
|
|
|
1149
1151
|
return new Promise((resolve, reject) => {
|
|
@@ -1453,7 +1455,10 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
1453
1455
|
args.unshift('--model', cliModel);
|
|
1454
1456
|
}
|
|
1455
1457
|
|
|
1456
|
-
|
|
1458
|
+
// Add direct-answer prefix to prevent agentic tool use (web search, file ops etc.)
|
|
1459
|
+
// Without this, Claude Code spends 160s doing agentic work instead of answering directly
|
|
1460
|
+
const directPrompt = `Answer this question directly from your knowledge. Do not use any tools, web searches, file operations, or external resources. Provide a concise, expert response in 2-4 paragraphs.\n\n${prompt}`;
|
|
1461
|
+
args.push(directPrompt);
|
|
1457
1462
|
return args;
|
|
1458
1463
|
}
|
|
1459
1464
|
|
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -3026,15 +3026,22 @@ To re-login: /polydev:login`
|
|
|
3026
3026
|
* Always uses 400s to ensure local CLIs get full time budget before falling back to credits
|
|
3027
3027
|
*/
|
|
3028
3028
|
getAdaptiveTimeout(cliId, defaultTimeout = 400000) {
|
|
3029
|
+
// Per-CLI timeout caps: Codex is consistently slower, don't let it block results
|
|
3030
|
+
const maxTimeouts = {
|
|
3031
|
+
'codex_cli': 120000, // 120s — Codex exec is slow
|
|
3032
|
+
'claude_code': 400000, // 400s — Claude needs time for agentic web search
|
|
3033
|
+
'gemini_cli': 300000, // 300s — Gemini is generally fast
|
|
3034
|
+
};
|
|
3035
|
+
const maxTimeout = maxTimeouts[cliId] || defaultTimeout;
|
|
3036
|
+
|
|
3029
3037
|
const times = this.cliResponseTimes[cliId];
|
|
3030
3038
|
if (!times || times.length === 0) {
|
|
3031
|
-
|
|
3039
|
+
console.error(`[Stdio Wrapper] CLI timeout for ${cliId}: ${maxTimeout / 1000}s (no history)`);
|
|
3040
|
+
return maxTimeout;
|
|
3032
3041
|
}
|
|
3033
3042
|
const avg = times.reduce((a, b) => a + b, 0) / times.length;
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
console.error(`[Stdio Wrapper] CLI timeout for ${cliId}: 400s (avg response: ${Math.round(avg)}ms from ${times.length} samples)`);
|
|
3037
|
-
return 400000;
|
|
3043
|
+
console.error(`[Stdio Wrapper] CLI timeout for ${cliId}: ${maxTimeout / 1000}s (avg response: ${Math.round(avg)}ms from ${times.length} samples)`);
|
|
3044
|
+
return maxTimeout;
|
|
3038
3045
|
}
|
|
3039
3046
|
|
|
3040
3047
|
/**
|