Skip to content

Commit 39462c0

Browse files
suryaiyer95claude
andcommitted
chore: add altimate_change markers to upstream-shared tool files
Wrap all telemetry additions in `packages/opencode/src/tool/tool.ts` and `packages/opencode/src/tool/skill.ts` with `// altimate_change start/end` markers so the upstream marker-guard CI passes. - `tool.ts`: markers around `import { Telemetry }` and the full telemetry instrumentation block (startTime through soft-failure core_failure emission) - `skill.ts`: markers around `classifySkillSource` helper, `startTime` declaration, and the `Telemetry.track` try-catch for `skill_used` Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 parent 4745297 commit 39462c0

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

‎packages/opencode/src/tool/skill.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ import os from "os"
1414

1515
const MAX_DISPLAY_SKILLS = 50
1616

17+
// altimate_change start — classifySkillSource helper for skill telemetry
1718
function classifySkillSource(location: string): "builtin" | "global" | "project" {
1819
if (location.includes("node_modules") || location.includes(".altimate/builtin")) return "builtin"
1920
if (location.startsWith(os.homedir())) return "global"
2021
return "project"
2122
}
2223
// altimate_change end
24+
// altimate_change end
2325

2426
export const SkillTool = Tool.define("skill", async (ctx) => {
2527
const list = await Skill.available(ctx?.agent)
@@ -91,7 +93,9 @@ export const SkillTool = Tool.define("skill", async (ctx) => {
9193
description,
9294
parameters,
9395
async execute(params: z.infer<typeof parameters>, ctx) {
96+
// altimate_change start — telemetry: startTime for skill_used duration
9497
const startTime = Date.now()
98+
// altimate_change end
9599
// altimate_change start - use upstream Skill.get() for exact name lookup
96100
const skill = await Skill.get(params.name)
97101

@@ -131,6 +135,7 @@ export const SkillTool = Tool.define("skill", async (ctx) => {
131135
return arr
132136
}).then((f) => f.map((file) => `<file>${file}</file>`).join("\n"))
133137

138+
// altimate_change start — telemetry instrumentation for skill loading
134139
try {
135140
Telemetry.track({
136141
type: "skill_used",
@@ -144,6 +149,7 @@ export const SkillTool = Tool.define("skill", async (ctx) => {
144149
} catch {
145150
// Telemetry must never break skill loading
146151
}
152+
// altimate_change end
147153

148154
return {
149155
title: `Loaded skill: ${skill.name}`,

‎packages/opencode/src/tool/tool.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import type { Agent } from "../agent/agent"
44
import type { PermissionNext } from "../permission/next"
55
import type { SessionID, MessageID } from "../session/schema"
66
import { Truncate } from "./truncation"
7+
// altimate_change start — telemetry instrumentation for tool execution
78
import { Telemetry } from "../altimate/telemetry"
9+
// altimate_change end
810

911
export namespace Tool {
1012
interface Metadata {
@@ -68,6 +70,7 @@ export namespace Tool {
6870
{ cause: error },
6971
)
7072
}
73+
// altimate_change start — telemetry instrumentation for tool execution
7174
const startTime = Date.now()
7275
let result: Awaited<ReturnType<typeof execute>>
7376
try {
@@ -156,6 +159,7 @@ export namespace Tool {
156159
} catch {
157160
// Telemetry must never break tool execution
158161
}
162+
// altimate_change end
159163
// Truncation runs after telemetry so I/O errors from
160164
// Truncate.output() are not misattributed as tool failures.
161165
if (result.metadata.truncated !== undefined) {

0 commit comments

Comments
 (0)