Skip to content

Commit 17f4a19

Browse files
anandgupta42claude
andcommitted
fix: track suggestion failures in warehouse-add telemetry
Per Surya's review — the catch block in warehouse-add now emits a `core_failure` event with `error_class: "internal"` and `input_signature: "post_connect_suggestions"` so we can monitor how often post-connect suggestions fail and why. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent b24d84e commit 17f4a19

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

‎packages/opencode/src/altimate/tools/warehouse-add.ts‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Tool } from "../../tool/tool"
33
import { Dispatcher } from "../native"
44
// altimate_change start — post-connect feature suggestions
55
import { PostConnectSuggestions } from "./post-connect-suggestions"
6+
import { Telemetry } from "../../telemetry"
67
// altimate_change end
78

89
export const WarehouseAddTool = Tool.define("warehouse_add", {
@@ -92,8 +93,23 @@ IMPORTANT: For private key file paths, always use "private_key_path" (not "priva
9293
warehouseType: result.type,
9394
})
9495
}
95-
} catch {
96-
// Suggestions must never break the add flow
96+
} catch (e) {
97+
// Suggestions must never break the add flow — but track the failure
98+
try {
99+
Telemetry.track({
100+
type: "core_failure",
101+
timestamp: Date.now(),
102+
session_id: Telemetry.getContext().sessionId || "unknown-session",
103+
tool_name: "warehouse_add",
104+
tool_category: "warehouse",
105+
error_class: "internal",
106+
error_message: Telemetry.maskString(e instanceof Error ? e.message : String(e)),
107+
input_signature: "post_connect_suggestions",
108+
duration_ms: 0,
109+
})
110+
} catch {
111+
// Telemetry itself failed — truly nothing we can do
112+
}
97113
}
98114
// altimate_change end
99115

0 commit comments

Comments
 (0)