Skip to content

fix: propagate telemetry opt-out to Python engine sidecar#227

Merged
anandgupta42 merged 2 commits intomainfrom
fix/propagate-telemetry-opt-out
Mar 18, 2026
Merged

fix: propagate telemetry opt-out to Python engine sidecar#227
anandgupta42 merged 2 commits intomainfrom
fix/propagate-telemetry-opt-out

Conversation

@suryaiyer95
Copy link
Contributor

@suryaiyer95 suryaiyer95 commented Mar 17, 2026

Fixes #228

Summary

When a user disables telemetry via the config file, the Python altimate_engine sidecar spawned by the bridge was unaware — it called altimate_core.init() without the disable flag, so telemetry still fired from the engine process.

This PR fixes the gap by:

  • Adding Telemetry.isEnabled() to expose post-init telemetry state
  • Awaiting Telemetry.init() in Bridge.start() before spawning the sidecar
  • Injecting ALTIMATE_TELEMETRY_DISABLED=true into the child environment when telemetry is disabled

Test Plan

Manually verified: set telemetry.disabled: true in ~/.config/altimate-code/altimate-code.json, start the CLI, confirm the engine subprocess does not emit telemetry events.

Checklist

  • Tests added/updated
  • Documentation updated (if needed)
  • CHANGELOG updated (if user-facing)

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>
Copilot AI review requested due to automatic review settings March 17, 2026 20:51
@claude
Copy link

claude bot commented Mar 17, 2026

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review.

@github-actions
Copy link

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 await Telemetry.init() before spawning the Python sidecar and inject ALTIMATE_TELEMETRY_DISABLED=true into 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>
@anandgupta42 anandgupta42 merged commit 2988e41 into main Mar 18, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Telemetry opt-out not propagated to Python engine sidecar

3 participants