Skip to content

Conversation

@GiGurra
Copy link

@GiGurra GiGurra commented Jan 24, 2026

Summary

Shell completions generated by sag completion fish|bash|zsh weren't working because maybeDefaultToSpeak() was intercepting Cobra's internal completion commands (__complete and __completeNoDesc).

The problem

When you type sag speak -v <TAB>, the shell runs something like:

sag __complete speak -v ""

But maybeDefaultToSpeak() didn't recognize __complete as a builtin, so it rewrote this to:

sag speak __complete speak -v ""

Which breaks completions entirely.

The fix

Add __complete and __completeNoDesc to isCobraBuiltin() so they pass through to Cobra's completion handler.

Test plan

  • Added test cases for __complete and __completeNoDesc
  • All existing tests pass
  • Linter passes

🤖 Generated with Claude Code

The maybeDefaultToSpeak() function was intercepting __complete and
__completeNoDesc commands that Cobra uses internally for shell
completions. This caused completions to fail silently.

Add these hidden commands to isCobraBuiltin() so they pass through
to Cobra's completion handler.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@GiGurra GiGurra marked this pull request as ready for review January 24, 2026 14:33
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.

1 participant