fix: CLI exit codes, config.yaml, setup agent key (RUN4.06-08) - #52
Merged
Conversation
…UN4.06, RUN4.07, RUN4.08) - Add apierror package with structured APIError type and exit code constants - Map HTTP 401/403 → exit 2, 404 → exit 3, 429 → exit 5, timeout → exit 4 - Update client.go to return *apierror.APIError instead of fmt.Errorf - Update main.go to call apierror.ExitCodeFrom(err) for correct exit codes - Add LoadFromPath to config.go; Load now reads ~/.alaya/config.yaml via yaml.v3, env vars override - Add createAPIKeyViaBootstrap to setup.go; setup agent creates key via ALAYA_BOOTSTRAP_KEY when none stored Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- LoadFromPath propagates non-ErrNotExist errors (permission denied, I/O) - ExitCodeFrom(nil) returns 0 instead of ExitGeneric - isTimeout checks context.DeadlineExceeded in addition to net.Error.Timeout() - Added tests: permission denied config, nil error, context deadline exceeded Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Items closed
Test plan
🤖 Generated with Claude Code