File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,13 @@ export function classifyError(ex: unknown): DiscoveryErrorType {
6363 if ( msg . includes ( 'timed out' ) || msg . includes ( 'timeout' ) ) {
6464 return 'spawn_timeout' ;
6565 }
66+
67+ // CLI command execution failures — checked before parse_error because command args
68+ // may contain words like "json" (e.g., 'Failed to run "conda info --envs --json"')
69+ if ( msg . includes ( 'failed to run' ) || msg . includes ( 'error spawning' ) ) {
70+ return 'command_failed' ;
71+ }
72+
6673 if ( msg . includes ( 'parse' ) || msg . includes ( 'unexpected token' ) || msg . includes ( 'json' ) ) {
6774 return 'parse_error' ;
6875 }
@@ -73,12 +80,6 @@ export function classifyError(ex: unknown): DiscoveryErrorType {
7380 return 'tool_not_found' ;
7481 }
7582
76- // CLI command execution failures — e.g., 'Failed to run "conda ..."',
77- // "Failed to run poetry ...", "Error spawning conda: ..."
78- if ( msg . includes ( 'failed to run' ) || msg . includes ( 'error spawning' ) ) {
79- return 'command_failed' ;
80- }
81-
8283 // PET process crash/hang recovery failures — e.g., "PET is currently restarting",
8384 // "failed after 3 restart attempts", "Failed to create stdio streams for PET process"
8485 if ( msg . includes ( 'restart' ) || msg . includes ( 'stdio stream' ) ) {
You can’t perform that action at this time.
0 commit comments