Skip to content

Commit 3c71187

Browse files
anandgupta42claude
andcommitted
fix: restore does not exist to validation error keywords
The keyword was removed in #611 to prevent HTTP 404 messages from being misclassified as validation errors. However, the pattern reordering (http_error now comes before validation) already handles that — HTTP 404 messages match `http_error` first via `"http 404"` keyword. Removing `"does not exist"` from validation caused SQL errors like `"column foo does not exist"` to fall through to `unknown`. Restore the keyword and add a test for the SQL case. Caught by multi-model code review (Claude + Gemini 3.1 Pro consensus). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 086d7b2 commit 3c71187

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

packages/opencode/src/altimate/telemetry/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ export namespace Telemetry {
795795
keywords: ["status code: 4", "status code: 5", "request failed with status", "http 404", "http 410", "http 429", "http 451", "http 403"],
796796
},
797797
// altimate_change end
798-
// altimate_change start — split file_stale out of validation; remove "does not exist" (was catching HTTP 404s)
798+
// altimate_change start — split file_stale out of validation for cleaner triage
799799
{
800800
class: "file_stale",
801801
keywords: [
@@ -811,6 +811,7 @@ export namespace Telemetry {
811811
"invalid",
812812
"missing",
813813
"required",
814+
"does not exist",
814815
],
815816
},
816817
// altimate_change end

packages/opencode/test/telemetry/telemetry.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,13 +1628,15 @@ describe("telemetry.classifyError", () => {
16281628
expect(Telemetry.classifyError("Invalid dialect specified")).toBe("validation")
16291629
expect(Telemetry.classifyError("Missing required field")).toBe("validation")
16301630
expect(Telemetry.classifyError("Required parameter 'query' not provided")).toBe("validation")
1631-
// altimate_change start — file_stale split out from validation; "does not exist" moved to http_error
1631+
// altimate_change start — file_stale split out from validation
16321632
// These are now classified as file_stale, not validation
16331633
expect(Telemetry.classifyError("You must read file /path/to/file before overwriting it")).toBe("file_stale")
16341634
expect(Telemetry.classifyError("File has been modified since it was last read")).toBe("file_stale")
16351635
expect(Telemetry.classifyError("You must read file before overwriting it. Use the Read tool first")).toBe("file_stale")
1636-
// HTTP 404 "does not exist" is now http_error
1636+
// HTTP 404 "does not exist" matches http_error first (pattern priority), not validation
16371637
expect(Telemetry.classifyError("HTTP 404: https://example.com/page does not exist")).toBe("http_error")
1638+
// SQL "does not exist" matches validation (no http_error keywords present)
1639+
expect(Telemetry.classifyError("error: column foo does not exist")).toBe("validation")
16381640
// altimate_change end
16391641
})
16401642

0 commit comments

Comments
 (0)