Skip to content

Commit ceaf8ff

Browse files
fix(telemetry): resolve race conditions, duplicate turns, and consent defaults
- Rewrite collector to Instance.state-scoped with dataLevel filtering and messageId deduplication to prevent duplicate turn finalizations - Fix integration user-message race by retrying after 50ms when parts are empty; use MessageV2.Event.Updated with time.completed instead of step-finish; clean up turnStartTimes entries; add SIGTERM/beforeExit flush - Fix Session.Event.Diff handler to use Snapshot.FileDiff shape (file, additions, deletions) instead of non-existent type/hunks/path fields - Rewrite consent to default OFF until explicit opt-in; add setLocalConsent and loadLocalConsent for KV store integration; add CODEQ_DISABLE_TELEMETRY env var kill switch via Flag namespace - Export setConsent/loadConsent from telemetry barrel
1 parent 2710913 commit ceaf8ff

5 files changed

Lines changed: 311 additions & 421 deletions

File tree

packages/opencode/src/flag/flag.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ export namespace Flag {
5151
export const OPENCODE_MODELS_URL = process.env["OPENCODE_MODELS_URL"]
5252
export const OPENCODE_MODELS_PATH = process.env["OPENCODE_MODELS_PATH"]
5353

54+
// qBraid / CodeQ flags
55+
export const CODEQ_DISABLE_TELEMETRY = truthy("CODEQ_DISABLE_TELEMETRY")
56+
5457
function number(key: string) {
5558
const value = process.env[key]
5659
if (!value) return undefined

0 commit comments

Comments
 (0)