polydev-ai 1.8.25 → 1.8.27
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 +19 -7
- package/package.json +1 -1
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -186,6 +186,12 @@ function cleanCliResponse(content) {
|
|
|
186
186
|
foundCodexMarker = true;
|
|
187
187
|
continue;
|
|
188
188
|
}
|
|
189
|
+
// Skip MCP startup logs (mcp: xxx starting/ready/failed)
|
|
190
|
+
if (trimmed.startsWith('mcp:')) continue;
|
|
191
|
+
if (trimmed.startsWith('mcp startup:')) continue;
|
|
192
|
+
// Skip RMCP transport errors
|
|
193
|
+
if (trimmed.includes('rmcp::transport')) continue;
|
|
194
|
+
if (trimmed.includes('ERROR rmcp')) continue;
|
|
189
195
|
// Skip everything in user section (echoed prompt, errors)
|
|
190
196
|
continue;
|
|
191
197
|
}
|
|
@@ -804,10 +810,11 @@ class StdioMCPWrapper {
|
|
|
804
810
|
|
|
805
811
|
/**
|
|
806
812
|
* Report CLI results to server for dashboard storage
|
|
807
|
-
* This stores CLI results in Supabase so they appear in the dashboard
|
|
813
|
+
* This stores ONLY SUCCESSFUL CLI results in Supabase so they appear in the dashboard
|
|
814
|
+
* Failed CLI results are not stored - they will get API fallback instead
|
|
808
815
|
*/
|
|
809
816
|
async reportCliResultsToServer(prompt, localResults, args = {}) {
|
|
810
|
-
// Only report
|
|
817
|
+
// Only report successful results to dashboard
|
|
811
818
|
const successfulResults = localResults.filter(r => r.success);
|
|
812
819
|
if (successfulResults.length === 0) {
|
|
813
820
|
console.error('[Stdio Wrapper] No successful CLI results to report');
|
|
@@ -820,11 +827,14 @@ class StdioMCPWrapper {
|
|
|
820
827
|
}
|
|
821
828
|
|
|
822
829
|
try {
|
|
823
|
-
|
|
830
|
+
// IMPORTANT: Only send successful results to dashboard
|
|
831
|
+
// Failed CLI results will have API fallback, so we don't want to show both
|
|
832
|
+
const cliResults = successfulResults.map(result => ({
|
|
824
833
|
provider_id: result.provider_id,
|
|
825
834
|
// IMPORTANT: cliManager returns model_used, not model
|
|
826
835
|
model: result.model_used || result.model || this.getModelPreferenceForCli(result.provider_id),
|
|
827
|
-
|
|
836
|
+
// Clean the content before sending to dashboard (remove metadata, MCP logs, etc.)
|
|
837
|
+
content: cleanCliResponse(result.content || ''),
|
|
828
838
|
tokens_used: result.tokens_used || 0,
|
|
829
839
|
latency_ms: result.latency_ms || 0,
|
|
830
840
|
success: result.success || false,
|
|
@@ -950,11 +960,13 @@ class StdioMCPWrapper {
|
|
|
950
960
|
|
|
951
961
|
console.error(`[Stdio Wrapper] Calling remote perspectives (excluding: ${excludeProviders.join(', ') || 'none'}, requesting: ${requestProviders.map(p => p.provider).join(', ') || 'any'}, max: ${maxPerspectives})`);
|
|
952
962
|
|
|
953
|
-
// Format CLI responses for logging on the server
|
|
954
|
-
|
|
963
|
+
// Format ONLY SUCCESSFUL CLI responses for logging on the server
|
|
964
|
+
// Failed CLI results should not be sent - they will get API fallback
|
|
965
|
+
const successfulCliResults = localResults.filter(r => r.success);
|
|
966
|
+
const cliResponses = successfulCliResults.map(result => ({
|
|
955
967
|
provider_id: result.provider_id,
|
|
956
968
|
model: result.model_used || this.getDefaultModelForCli(result.provider_id),
|
|
957
|
-
content: result.content || '',
|
|
969
|
+
content: cleanCliResponse(result.content || ''),
|
|
958
970
|
tokens_used: result.tokens_used || 0,
|
|
959
971
|
latency_ms: result.latency_ms || 0,
|
|
960
972
|
success: result.success || false,
|
package/package.json
CHANGED