Skip to content

chore(cli): track output_format and fix is_agent CI parity#5513

Open
pamelachia wants to merge 2 commits into
developfrom
pamela/growth-912-output-format-and-detection-parity
Open

chore(cli): track output_format and fix is_agent CI parity#5513
pamelachia wants to merge 2 commits into
developfrom
pamela/growth-912-output-format-and-detection-parity

Conversation

@pamelachia

Copy link
Copy Markdown
Contributor

Summary

Adds an output_format property to the cli_command_executed telemetry event and fixes a Go/TS divergence in how is_agent is computed. Together these make the JSON-vs-human output choice measurable and ensure both CLI shells agree on what counts as an agent. This is the measurement-and-parity groundwork for auto-switching agents to JSON output (next subissue under GROWTH-806).

Changes

  • Record the resolved output format on every cli_command_executed. Added output_format to the Go catalog (events.go) and its TS mirror (event-catalog.ts), and emit it from the Go capture and both TS instrumentation paths. db query resolves its format into a command-local flag, so it now mirrors the resolved value onto the global that telemetry reads, keeping the value accurate for the highest-volume agent command. The property does not exist today, so current JSON usage is unmeasurable without it.
  • Fix is_agent Go/TS parity. The TS legacy analytics layer folded CI into is_agent (is_agent = aiTool || isCi), tagging CI environments as agents while the Go binary does not. is_agent now reflects coding-agent detection only, matching Go on both shells. is_ci continues to be reported as its own separate property.

Notes for reviewers

  • output_format values are shell-native (Go: pretty|json|yaml|toml|env; TS: text|json|stream-json), disambiguated by $lib; normalize in analysis.
  • Deliberately out of scope: aligning the CI env-var lists across the two shells. runtime.isCi gates behavior in legacy-platform-api.layer.ts, so changing those lists would alter non-interactive behavior for some CI environments. That belongs in a separate change, not this telemetry-parity fix.
  • The three instrumentation/platform-api unit tests now provide a mock Output because the instrumentation reads output.format.

Linear

  • fixes GROWTH-912
  • parent GROWTH-806

@pamelachia pamelachia requested a review from a team as a code owner June 8, 2026 16:17
@pamelachia pamelachia self-assigned this Jun 8, 2026
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 27151276534

Coverage decreased (-0.03%) to 64.287%

Details

  • Coverage decreased (-0.03%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 31 coverage regressions across 4 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

31 previously-covered lines in 4 files lost coverage.

File Lines Losing Coverage Coverage
cmd/root.go 17 7.63%
cmd/db.go 8 52.17%
internal/utils/git.go 5 53.33%
internal/telemetry/events.go 1 28.57%

Coverage Stats

Coverage Status
Relevant Lines: 16151
Covered Lines: 10383
Line Coverage: 64.29%
Coverage Strength: 7.04 hits per line

💛 - Coveralls

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Supabase CLI preview

npx --yes https://pkg.pr.new/supabase@5513

Preview package for commit 5555f26.

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