fix: propagate telemetry opt-out to Python engine sidecar#227
fix: propagate telemetry opt-out to Python engine sidecar#227anandgupta42 merged 2 commits intomainfrom
Conversation
When altimate-code has telemetry disabled (env var or config file), the Python engine (altimate_core) must also not send telemetry. Two changes: - \`Telemetry.isEnabled()\`: new export that returns \`true\` only after \`init()\` has completed and telemetry is active - \`Bridge.start()\`: awaits \`Telemetry.init()\` before spawning the Python process, then injects \`ALTIMATE_TELEMETRY_DISABLED=true\` into the child's environment when telemetry is disabled The child process inherits the parent env already, so env-var-based opt-outs propagate automatically. This change closes the gap for config-file-based opt-outs (\`telemetry.disabled: true\` in \`altimate-code.json\`), where no env var is set in the shell. Companion change in altimate-core: \`init()\` now reads \`ALTIMATE_TELEMETRY_DISABLED\` and forces \`telemetry=False\`. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude Code ReviewThis repository is configured for manual code reviews. Comment |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
There was a problem hiding this comment.
Pull request overview
Propagates altimate-code’s telemetry opt-out state to the Python altimate-engine sidecar so that disabling telemetry via config (not just shell env vars) prevents the engine from emitting telemetry.
Changes:
- Adds
Telemetry.isEnabled()to expose “init completed + telemetry active” state. - Updates
Bridge.start()to awaitTelemetry.init()before spawning the Python sidecar and injectALTIMATE_TELEMETRY_DISABLED=trueinto the child environment when telemetry is disabled.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/opencode/src/altimate/telemetry/index.ts | Adds Telemetry.isEnabled() helper to reflect post-init enabled state. |
| packages/opencode/src/altimate/bridge/client.ts | Awaits telemetry init before spawn and conditionally injects ALTIMATE_TELEMETRY_DISABLED into the sidecar env. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
- isEnabled() state machine: false before init, false when disabled via ALTIMATE_TELEMETRY_DISABLED, true when enabled, false after shutdown - Bridge source inspection: verifies ALTIMATE_TELEMETRY_DISABLED is injected into childEnv before spawn when Telemetry.isEnabled() is false Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fixes #228
Summary
When a user disables telemetry via the config file, the Python
altimate_enginesidecar spawned by the bridge was unaware — it calledaltimate_core.init()without the disable flag, so telemetry still fired from the engine process.This PR fixes the gap by:
Telemetry.isEnabled()to expose post-init telemetry stateTelemetry.init()inBridge.start()before spawning the sidecarALTIMATE_TELEMETRY_DISABLED=trueinto the child environment when telemetry is disabledTest Plan
Manually verified: set
telemetry.disabled: truein~/.config/altimate-code/altimate-code.json, start the CLI, confirm the engine subprocess does not emit telemetry events.Checklist