polydev-ai 1.9.34 → 1.9.36
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/mcp/stdio-wrapper.js +11 -10
- package/package.json +1 -1
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -2187,9 +2187,10 @@ To re-login: /polydev:login`
|
|
|
2187
2187
|
}
|
|
2188
2188
|
});
|
|
2189
2189
|
|
|
2190
|
-
//
|
|
2191
|
-
|
|
2192
|
-
|
|
2190
|
+
// Wait for ALL CLIs — they're free, so always collect all of them
|
|
2191
|
+
// If 3 CLIs available, wait for all 3. If 2, wait for both. Credits fill remaining slots.
|
|
2192
|
+
localResults = await this.collectFirstNSuccesses(cliPromises, cliPromises.length);
|
|
2193
|
+
console.error(`[Stdio Wrapper] CLI collect: got ${localResults.filter(r => r.success).length} successful, ${localResults.filter(r => !r.success).length} failed out of ${cliPromises.length} CLIs`);
|
|
2193
2194
|
this.sendProgressNotification(progressToken, 55, 100, `Got ${localResults.filter(r => r.success).length} CLI responses`);
|
|
2194
2195
|
}
|
|
2195
2196
|
|
|
@@ -2408,8 +2409,8 @@ To re-login: /polydev:login`
|
|
|
2408
2409
|
const response = await fetch(`${this.serverUrl}/report-cli-results`, {
|
|
2409
2410
|
method: 'POST',
|
|
2410
2411
|
headers: {
|
|
2411
|
-
'Authorization': `Bearer ${this.userToken}`,
|
|
2412
2412
|
'Content-Type': 'application/json',
|
|
2413
|
+
'Authorization': `Bearer ${this.userToken}`,
|
|
2413
2414
|
'User-Agent': 'polydev-stdio-wrapper/1.0.0'
|
|
2414
2415
|
},
|
|
2415
2416
|
body: JSON.stringify(reportPayload)
|
|
@@ -2820,18 +2821,18 @@ To re-login: /polydev:login`
|
|
|
2820
2821
|
|
|
2821
2822
|
/**
|
|
2822
2823
|
* Get adaptive timeout for a CLI based on historical response times
|
|
2823
|
-
*
|
|
2824
|
+
* Always uses 400s to ensure local CLIs get full time budget before falling back to credits
|
|
2824
2825
|
*/
|
|
2825
2826
|
getAdaptiveTimeout(cliId, defaultTimeout = 400000) {
|
|
2826
2827
|
const times = this.cliResponseTimes[cliId];
|
|
2827
2828
|
if (!times || times.length === 0) {
|
|
2828
|
-
return defaultTimeout; // No history, use default
|
|
2829
|
+
return defaultTimeout; // No history, use default (400s)
|
|
2829
2830
|
}
|
|
2830
2831
|
const avg = times.reduce((a, b) => a + b, 0) / times.length;
|
|
2831
|
-
//
|
|
2832
|
-
|
|
2833
|
-
console.error(`[Stdio Wrapper]
|
|
2834
|
-
return
|
|
2832
|
+
// Always use 400s — local CLIs should get full time budget
|
|
2833
|
+
// Complex prompts need the full timeout; premature timeouts waste credits
|
|
2834
|
+
console.error(`[Stdio Wrapper] CLI timeout for ${cliId}: 400s (avg response: ${Math.round(avg)}ms from ${times.length} samples)`);
|
|
2835
|
+
return 400000;
|
|
2835
2836
|
}
|
|
2836
2837
|
|
|
2837
2838
|
/**
|