Found during the v0.11.1 release review (Chaos Gremlin / privacy persona). Deferred because: needs a design decision on how doInit() should read the user's global config without an Instance.
Problem. Telemetry.doInit() (packages/opencode/src/altimate/telemetry/index.ts) reads telemetry.disabled through Config.get(), which throws outside an Instance context. On failure it proceeds as enabled. The CLI middleware in packages/opencode/src/index.ts calls Telemetry.init() before Instance.provide(), so on the main thread a config-file opt-out ("telemetry": {"disabled": true} in the global altimate-code.json) is not honored for main-thread events (onboarding, first_launch, startup_ready, main-thread event_loop_stall). Only the env-var opt-out (ALTIMATE_TELEMETRY_DISABLED / OPENCODE_DISABLE_TELEMETRY) is reliable there.
v0.11.1 fixed the same bypass on the TUI worker (init moved inside Instance.restore), but the main-thread path is pre-existing and remains.
Also missing: no test anywhere exercises the config-file opt-out; only the env vars are tested (test/telemetry/telemetry.test.ts).
Suggested fix. When Config.get() throws, fall back to reading the global config files under Global.Path.config directly (same list config.ts merges) for the single telemetry.disabled key, and add a test that a config-file opt-out disables telemetry both inside and outside an Instance.
Found during the v0.11.1 release review (Chaos Gremlin / privacy persona). Deferred because: needs a design decision on how
doInit()should read the user's global config without an Instance.Problem.
Telemetry.doInit()(packages/opencode/src/altimate/telemetry/index.ts) readstelemetry.disabledthroughConfig.get(), which throws outside an Instance context. On failure it proceeds as enabled. The CLI middleware inpackages/opencode/src/index.tscallsTelemetry.init()beforeInstance.provide(), so on the main thread a config-file opt-out ("telemetry": {"disabled": true}in the globalaltimate-code.json) is not honored for main-thread events (onboarding, first_launch, startup_ready, main-thread event_loop_stall). Only the env-var opt-out (ALTIMATE_TELEMETRY_DISABLED/OPENCODE_DISABLE_TELEMETRY) is reliable there.v0.11.1 fixed the same bypass on the TUI worker (init moved inside
Instance.restore), but the main-thread path is pre-existing and remains.Also missing: no test anywhere exercises the config-file opt-out; only the env vars are tested (
test/telemetry/telemetry.test.ts).Suggested fix. When
Config.get()throws, fall back to reading the global config files underGlobal.Path.configdirectly (same listconfig.tsmerges) for the singletelemetry.disabledkey, and add a test that a config-file opt-out disables telemetry both inside and outside an Instance.