Add interactive mode telemetry to track terminal capabilities#4449
Open
simonfaltum wants to merge 1 commit intomainfrom
Open
Add interactive mode telemetry to track terminal capabilities#4449simonfaltum wants to merge 1 commit intomainfrom
simonfaltum wants to merge 1 commit intomainfrom
Conversation
simonfaltum
commented
Feb 5, 2026
Comment on lines
+80
to
+83
| if c.SupportsPrompt() { | ||
| return InteractiveModeFull | ||
| } |
Member
Author
There was a problem hiding this comment.
SupportsPrompt requires SupportsInteractive as well, so thats why we can do the logic this way
This change adds a new `interactive_mode` field to telemetry to measure what proportion of CLI invocations can support interactive features like selection prompts. The field captures one of three values: - "full": Both interactive output (spinners, colors) and user prompts are supported. This requires stderr to be a TTY, color enabled, stdin to be a TTY, and not running in Git Bash. - "output_only": Interactive output is supported but prompts are not. This occurs when stdin is not a TTY (e.g., input piped) or when running in Git Bash (which has broken readline/ANSI support). - "none": Non-interactive environment where neither spinners nor prompts work. This includes CI/CD pipelines, cron jobs, and cases where stderr is redirected. This telemetry helps inform decisions about when the CLI can prompt users for missing information versus requiring explicit flags. Changes: - Add InteractiveMode field to ExecutionContext in telemetry protos - Add InteractiveMode() method to Capabilities struct in cmdio - Add GetInteractiveMode(ctx) public function for context-safe access - Populate the field during telemetry upload in root.Execute() - Add comprehensive tests for all three interactive modes
5df80af to
cbf3069
Compare
Collaborator
|
Commit: cbf3069
21 interesting tests: 7 KNOWN, 5 SKIP, 5 RECOVERED, 4 flaky
Top 50 slowest tests (at least 2 minutes):
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change adds a new
interactive_modefield to telemetry to measure what proportion of CLI invocations can support interactive features like selection prompts.The field captures one of three values:
Changes
InteractiveModefield toExecutionContextin telemetry protosInteractiveMode()method toCapabilitiesstruct in cmdioGetInteractiveMode(ctx)public function for context-safe accessroot.Execute()Why
This telemetry helps inform decisions about when the CLI can prompt users for missing information versus requiring explicit flags. By measuring the proportion of invocations in each mode, we can understand how often interactive prompts would actually be shown to users.
This will also help give us some numbers when we want to track impact of a given change
Tests
Added unit tests in
capabilities_test.gocovering all three interactive modes: