errors: add source-aware auth error hints#123
Merged
somanshreddy merged 4 commits intomainfrom Apr 28, 2026
Merged
Conversation
…e resolved credentials path Co-Authored-By: Claude Opus 4.6 <[email protected]>
JSON-encode the expected path before matching against stderr output. On Windows, filepath backslashes are doubled in JSON but not in the Go filepath string. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Tests for enrichAuthHint live alongside their source in context.go. Co-Authored-By: Claude Opus 4.6 <[email protected]>
32d8eef to
7788985
Compare
jrusso1020
approved these changes
Apr 28, 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.
Description
PostHog analytics (Apr 21-27) showed 103 installs hitting
auth_errororunauthorizedacross commands like
video list,avatar list, andlipsync get. Onlyauth statushad any auth hint; every other command returned the bare API message with no guidance
on what to fix.
This PR centralizes auth hint enrichment so every command that hits a 401/403 gets
source-aware guidance:
HEYGEN_API_KEYenv var is invalid/expired andlinks to the API key page
heygen auth loginEnrichment runs once in the centralized error path (
main.goafterExecuteC()),not scattered across individual commands.
auth status's manual hint injection isremoved since it's now handled centrally.
Testing
chain_resolver_test.go:ResolveWithSourcereturns correct source for env, file, and neither-configured casescontext_test.go: env-source 401, file-source 401, non-auth errors are untouched, existing hints are preservedauth_status_test.goto verify centralized hintmake testpasses (Linux, macOS, Windows)🤖 Generated with Claude Code