Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/opencode/src/altimate/bridge/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,19 @@ export namespace Bridge {
async function start() {
await ensureEngine()
const pythonCmd = resolvePython()

// Propagate altimate-code's telemetry opt-out to the Python engine.
// The engine calls altimate_core.init() lazily; this env var ensures
// it won't send telemetry when the user has disabled it here.
await Telemetry.init()
const childEnv = { ...process.env }
if (!Telemetry.isEnabled()) {
childEnv.ALTIMATE_TELEMETRY_DISABLED = "true"
}

child = spawn(pythonCmd, ["-m", "altimate_engine.server"], {
stdio: ["pipe", "pipe", "pipe"],
env: childEnv,
})

buffer = ""
Expand Down
5 changes: 5 additions & 0 deletions packages/opencode/src/altimate/telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,11 @@ export namespace Telemetry {
return { sessionId, projectId }
}

/** Returns true only after init() has completed and telemetry is enabled. */
export function isEnabled(): boolean {
return initDone && enabled
}

export function track(event: Event) {
// Before init completes: buffer (flushed once init enables, or cleared if disabled).
// After init completed and disabled telemetry: drop silently.
Expand Down
Loading