Remove GitHub API call from CLI initialization hot path#16699
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Removed getCurrentGitHubUsername() call from command initialization (line 181-185) - Updated --host-repo flag description to use generic placeholder '<username>/gh-aw-trial' - Username resolution still happens lazily in RunWorkflowTrials() when needed (line 298) - Eliminates slow GitHub API call in hot path of every CLI command - Command initialization now executes in ~11ms instead of potentially seconds Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove resolving GitHub username from CLI command path
Remove GitHub API call from CLI initialization hot path
Feb 19, 2026
pelikhan
approved these changes
Feb 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes a GitHub API call from the CLI initialization hot path to improve performance. Previously, every invocation of the CLI triggered an API call to fetch the current username, even for commands that didn't need it.
Changes:
- Removed
getCurrentGitHubUsername()call fromNewTrialCommand()initialization - Updated
--host-repoflag description to use static placeholder text<username>/gh-aw-trial - Preserved lazy username resolution in
RunWorkflowTrials()when the flag value is needed
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Feb 19, 2026
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.
The trial command was calling
getCurrentGitHubUsername()during initialization to populate the--host-repoflag's default value description. This GitHub API call executed on every CLI invocation, adding unnecessary latency to all commands.Changes
Removed hot path API call
getCurrentGitHubUsername()invocation fromNewTrialCommand()initialization--host-repoflag description to use static placeholder<username>/gh-aw-trialPreserved lazy resolution
RunWorkflowTrials()when no--host-repois providedCommand initialization now executes in ~11ms instead of potentially several seconds depending on network latency.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.