-
Notifications
You must be signed in to change notification settings - Fork 142
Add interactive mode telemetry to track terminal capabilities #4449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
simonfaltum
wants to merge
1
commit into
main
Choose a base branch
from
simonfaltum/telemetry-interactive-mode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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):
|
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: