Skip to content

fix: handle errors in /help command gracefully (#4992)#4994

Open
jjjojoj wants to merge 1 commit intoAider-AI:mainfrom
jjjojoj:fix-help-command-no-provider
Open

fix: handle errors in /help command gracefully (#4992)#4994
jjjojoj wants to merge 1 commit intoAider-AI:mainfrom
jjjojoj:fix-help-command-no-provider

Conversation

@jjjojoj
Copy link
Copy Markdown

@jjjojoj jjjojoj commented Apr 5, 2026

Summary

Fixes #4992

The /help command could crash with litellm.BadRequestError when no LLM provider is set, or RuntimeError when the embedding model fails to load.

Changes

  • Wrapped Help() initialization in try-except to catch RuntimeError and other exceptions
  • Wrapped Coder.create() in try-except to handle LLM provider errors
  • Wrapped coder.run() in try-except to handle runtime errors
  • Shows user-friendly error messages instead of crashing

Test plan

  • Run /help <question> without a configured LLM provider - should show error message instead of crashing
  • Run /help when network is unavailable (embedding model download fails) - should show error message instead of crashing

The /help command could crash with litellm.BadRequestError when no
provider is set, or RuntimeError when embedding model fails to load.
Wrap Help() init, Coder.create(), and coder.run() in try-except to
show user-friendly error messages instead of crashing.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 5, 2026

CLA assistant check
All committers have signed the CLA.

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.

/help token raises error

2 participants