Merged
Conversation
defaultToRun() was not recognizing __complete and __completeNoDesc as subcommands, causing it to prepend 'run' to completion args. This made the run command try to resolve '__complete' as an OCI agent reference, resulting in a ~1.2s network call to Docker Hub on every tab completion. Add __complete and __completeNoDesc to isSubcommand() so they are passed through directly, reducing completion time from ~1.2s to ~30ms. Assisted-By: cagent
krissetto
approved these changes
Feb 19, 2026
There was a problem hiding this comment.
Review Summary
✅ Approved - No issues found
The changes look good! This PR makes a straightforward enhancement to the completion handling:
- Code change: Refactored
isSubcommand()to use a switch statement and added__completeand__completeNoDescas recognized special commands - Testing: Added appropriate test cases to verify the new completion commands are passed through correctly
- Impact: As described, this should significantly improve completion time from ~1.2s to ~30ms by ensuring completion commands bypass the default "run" prepending logic
The implementation is clean, well-tested, and matches the intended behavior.
trungutt
approved these changes
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.
Add __complete and __completeNoDesc to isSubcommand() so they are passed through directly, reducing completion time from ~1.2s to ~30ms.
Assisted-By: cagent