Skip to content

trinity_version always reports "unknown": operator-intake and export read GIT_COMMIT_SHORT, which nothing sets #4381

Closed

Description

@vybe

trinity_version is read from GIT_COMMIT_SHORT, an environment variable this repo never sets. Both call sites therefore fall through to the "unknown" default on every install, always — so the field carries no information and silently misleads anyone reading it.

Where

src/backend/services/operator_intake_service.py:219
    "trinity_version": os.getenv("GIT_COMMIT_SHORT", "unknown"),

src/backend/routers/agent_data.py:302
    "trinity_version": os.getenv("GIT_COMMIT_SHORT", "unknown"),

grep -rn GIT_COMMIT_SHORT . over the whole repo returns exactly those two lines. There is no ARG, no ENV, no compose build.args entry, no start.sh export that sets it. The platform's real version env var is VERSION (build-stamped and wired through docker-compose backend.build.args + start.sh, per the comment at main.py:1860), plus the VERSION file.

Why it matters

  1. Every operator-intake notice reports Trinity version: unknown. A reader naturally infers something about that install — pre-release build, broken version endpoint, install that cannot phone home. All of those inferences are false: the value is the same constant for every install, healthy or not. The field looks like a signal and is not one.
  2. ent#466 (presence heartbeat) is specified on top of this field, describing it as // existing (GIT_COMMIT_SHORT / /api/version). Built as written, a new default-on telemetry stream inherits a constant "unknown" and the defect gets harder to see.
  3. The export payload at agent_data.py:302 has the same hole.

The helper already exists

src/backend/utils/app_version.py::resolve_release_version() was written for exactly this (ent#437): VERSION env var with any +g<sha> build suffix stripped, then /app/VERSION, then the repo-root VERSION file, and "unknown" only as a genuine last resort.

Its module docstring also rules out the variable these two call sites are reaching for: "The telemetry aggregate must carry the RELEASE version — never the commit SHA. Version-adoption timing is a join key: a per-commit value re-links the anonymous share stream to the identified presence/intake streams." So GIT_COMMIT_SHORT is both unset and the wrong thing to want.

Suggested fix

Replace both os.getenv("GIT_COMMIT_SHORT", "unknown") calls with resolve_release_version(). Two one-line changes against an existing, tested helper.

Note the operator-intake payload is an identified stream, so the anonymity argument in that docstring is weaker here than for the share stream — but the release version is still the right value and the SHA is still the wrong one.

Acceptance criteria

  1. Both call sites resolve the version through utils/app_version.resolve_release_version().
  2. An operator-intake notice from a tagged release build reports that release version, not "unknown".
  3. A test pins that "unknown" appears only when no VERSION env var and no VERSION file can be read — so a regression to an unset variable fails CI.
  4. Either GIT_COMMIT_SHORT is gone from the tree, or something sets it.
  5. ent#466 is updated so its payload spec no longer cites GIT_COMMIT_SHORT.

Not claimed

I have not checked whether any downstream consumer already treats trinity_version as unreliable, and I have not read the enterprise submodule for other readers of the same variable.

Found while triaging why three fresh self-hosted installs all reported Trinity version: unknown — the answer is that every install does.

Activity

  1. added
    priority-p2
    type-bug
    theme-reliability
    complexity-low
    status-ready
    on Nov 9, 2026
  2. added
    status-in-dev
    on Nov 11, 2026
  3. removed
    status-ready
    on Nov 16, 2026
  4. removed
    status-in-dev
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-lowpriority-p2theme-reliabilitytype-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions