Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit codes when model call fails #516

Closed
cboecking opened this issue May 17, 2024 · 0 comments · Fixed by #518
Closed

Exit codes when model call fails #516

cboecking opened this issue May 17, 2024 · 0 comments · Fixed by #518

Comments

@cboecking
Copy link

There are times when a model call fails. aichat should return a non-zero error code when this happens.

Here is an example where aichat works as expected. When the file is not present, aichat returns the error and an error code greater than zero. As a result, the starship prompt shows a red > prompt.

Screenshot from 2024-05-17 11-39-48

Here is an example where aichat experiences a model error when using claude. aichat return the error message; however, it return a 0 error code. As a result, the starship prompt shows a white > prompt.

Screenshot from 2024-05-17 11-41-02

In order for me to create well behaved scripts, I need aichat to return a non-zero error code in these circumstances.

config
❯ aichat --info
model claude:claude-3-opus-20240229
temperature -
dry_run false
save true
save_session -
highlight true
light_theme false
wrap no
wrap_code false
auto_copy false
keybindings vi
prelude -
compress_threshold 2000
config_file /home/cb/.config/aichat/config.yaml
roles_file /home/cb/.config/aichat/roles.yaml
messages_file /home/cb/.config/aichat/messages.md
sessions_dir /home/cb/.config/aichat/sessions

env
❯ aichat --version
aichat 0.16.0

❯ cat /etc/os-release
NAME="Pop!_OS"
VERSION="22.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"

terminal: alacrity

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 a pull request may close this issue.

1 participant