Skip to content

Clean up context, agent and ci_system event properties#2021

Merged
schnie merged 4 commits intomainfrom
fix-telemetry-context
Mar 2, 2026
Merged

Clean up context, agent and ci_system event properties#2021
schnie merged 4 commits intomainfrom
fix-telemetry-context

Conversation

@schnie
Copy link
Member

@schnie schnie commented Feb 27, 2026

Summary

  • Split DetectContext() into three independent functions: DetectAgent(), DetectCISystem(), and IsInteractive() — the old function mixed agent, CI, and interactivity into a single field, making it impossible to see e.g. Claude Code running inside GitHub Actions
  • Updated telemetry payload: context is now "interactive" / "non-interactive", with separate agent and ci_system properties added only when detected
  • Disabled telemetry in test runs: added isTestRun() detection (checks for .test binary suffix) to prevent Go test binaries from sending real events to prod

Test plan

  • go build ./...
  • go test ./pkg/telemetry/... -v — all tests pass including new TestDetectAgent, TestDetectCISystem, TestIsInteractive, TestIsTestRun
  • golangci-lint run ./pkg/telemetry/... — no issues
  • Manual: ASTRO_TELEMETRY_DEBUG=1 GITHUB_ACTIONS=true astro version — verify context, agent, and ci_system appear independently

@schnie schnie requested a review from a team as a code owner February 27, 2026 18:39
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@schnie schnie changed the title Split telemetry context into independent properties and disable in tests Clean up context, agent and ci_system event properties Feb 27, 2026
schnie and others added 2 commits February 27, 2026 13:44
Agents: Cursor (CURSOR_AGENT), Snowflake Cortex, Gemini CLI, OpenCode, Codex
CI: Jenkins (HUDSON_URL), Azure DevOps, Bitbucket Pipelines, AWS CodeBuild,
TeamCity, Buildkite, Codefresh, Travis CI

Aligns with astronomer/agents#141.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Removes duplicated agent/CI env var lists in tests by reading
directly from agentEnvVars and ciEnvVars via a helper function.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@schnie schnie force-pushed the fix-telemetry-context branch from a17cd42 to 8cdc254 Compare February 27, 2026 19:46
@schnie schnie merged commit 7ab8cc9 into main Mar 2, 2026
5 of 6 checks passed
@schnie schnie deleted the fix-telemetry-context branch March 2, 2026 15:37
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.

2 participants