Skip to content

fix(telemetry): report the running CLI version independently - #514

Merged
hasandemirkiran merged 3 commits into
mainfrom
fix/report-running-cli-version
Sep 19, 2026
Merged

hasandemirkiran merged 3 commits into
mainfrom
fix/report-running-cli-version

Conversation

@hasandemirkiran

Copy link
Copy Markdown
Contributor

Summary

The daemon currently omits device.cli_version, so the hosted installation cannot distinguish its running CLI release from an MDM package marker. Report the daemon's linked BinaryVersion in every ledger batch and idle heartbeat. For example, a daemon running CLI 1.5.2 with an MDM marker of 1.5.1 now sends cli_version: "1.5.2" and deployment_version: "1.5.1".

Preserve the existing deployment marker and self-serve cli-<version> fallback. Omit unknown/blank CLI versions, and include device metadata when the CLI version is the only available fact. The backend already accepts and persists this optional field.

Regression coverage checks the raw JSON for both ledger and heartbeat paths, standalone versions, development builds, omission, marker changes, and daemon-to-stream version plumbing. This reports the linked release label; existing endpoints need a daemon built with this change before they can populate the field.

Verification

  • go test ./...
  • go test -race ./...
  • go vet ./...
  • go build ./...
  • go mod verify
  • go run ./cmd/kontext guard smoke-test
  • KONTEXT_E2E_PORT=48783 make guard-e2e
  • After rebasing onto current main: race tests and vet for internal/managedstream, internal/managedobserve, and cmd/kontext

Release notes

  • Conventional commit title matches semver intent (patch telemetry fix).

Copy link
Copy Markdown
Contributor Author

How to use the Graphite Merge Queue

Add the label queue_me to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@hasandemirkiran
hasandemirkiran marked this pull request as ready for review September 18, 2026 15:00
@greptile-apps

greptile-apps Bot commented Sep 18, 2026

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the running CLI version is consistently propagated without changing deployment-marker semantics.

Summary

The PR separates the running daemon’s linked CLI release from the deployment package marker in managed telemetry.

  • Propagates the normalized daemon BinaryVersion into managed-stream options.
  • Emits trimmed device.cli_version metadata for ledger batches and idle heartbeats.
  • Preserves independently refreshed device.deployment_version behavior.
  • Adds regression coverage for release, development, blank, standalone, and marker-change scenarios.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[RunDaemon] -->|normalize BinaryVersion| B[runManagedStream]
    B --> C[flushManagedStream]
    C -->|CLIVersion| D[managedstream.Flush]
    D -->|ledger records| E[newPayload]
    D -->|idle heartbeat| E
    E --> F[device.cli_version]
    G[Deployment marker] -->|resolved per flush| E
    E --> H[device.deployment_version]
Loading

Reviews (2) · Last reviewed commit: "Merge branch 'main' into fix/report-runn..."

@hasandemirkiran
hasandemirkiran merged commit 885e31f into main Sep 19, 2026
4 checks passed
@hasandemirkiran
hasandemirkiran deleted the fix/report-running-cli-version branch September 19, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant