MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / errorCodeOf

Function errorCodeOf

src/agent/recovery.ts:138–144  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

136 */
137/** Classify a tool error result into a coarse code for loop detection. */
138export function errorCodeOf(content: string): string {
139 if (typeof content !== 'string') return 'ERROR';
140 const m = content.match(/^\s*\[([A-Z_]+)\]/);
141 if (m) return m[1]!;
142 if (/does not exist|not found|no such file/i.test(content)) return 'FILE_NOT_FOUND';
143 return 'ERROR';
144}
145
146/**
147 * A result can be a "soft failure": the tool itself returned success (exit 0, isError=false) but the

Callers 3

recovery.test.tsFile · 0.85
noteResultMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected