Skip to content

Commit 79ff93a

Browse files
suryaiyer95claude
andcommitted
fix: [AI-5975] distinguish infrastructure errors from validation findings in validate tool
Validation findings (e.g., "table not found") are semantic results, not operational failures. Only `result.error` / `data.error` (infrastructure errors) should set `success: false`. Validation findings still populate `metadata.error` for telemetry but keep `success: true`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent efef758 commit 79ff93a

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

packages/opencode/src/altimate/tools/altimate-core-validate.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ export const AltimateCoreValidateTool = Tool.define("altimate_core_validate", {
2323
schema_context: args.schema_context,
2424
})
2525
const data = (result.data ?? {}) as Record<string, any>
26-
const error = result.error ?? data.error ?? extractValidationErrors(data)
27-
const isRealFailure = !!error
26+
// Infrastructure errors (dispatcher/handler failures) vs validation findings.
27+
// "table not found" is a valid analysis result, not an operational failure.
28+
const infraError = result.error ?? data.error
29+
const findingsError = extractValidationErrors(data)
30+
const error = infraError ?? findingsError
2831
return {
29-
title: isRealFailure ? "Validate: ERROR" : `Validate: ${data.valid ? "VALID" : "INVALID"}`,
30-
metadata: { success: !isRealFailure, valid: data.valid, ...(error && { error }) },
32+
title: infraError ? "Validate: ERROR" : `Validate: ${data.valid ? "VALID" : "INVALID"}`,
33+
metadata: { success: !infraError, valid: data.valid, ...(error && { error }) },
3134
output: formatValidate(data),
3235
}
3336
} catch (e) {

0 commit comments

Comments
 (0)