Skip to content

feat: Enhance error messages for missing optional server dependencies…#307

Closed
hikariming wants to merge 1 commit intoOpenBMB:mainfrom
hikariming:pr/docker-config
Closed

feat: Enhance error messages for missing optional server dependencies…#307
hikariming wants to merge 1 commit intoOpenBMB:mainfrom
hikariming:pr/docker-config

Conversation

@hikariming
Copy link
Copy Markdown

This PR improves the developer experience when running ultrarag build with only base dependencies installed.

Previously, if an optional MCP server (for example evaluation) failed to start due to missing extras, the CLI surfaced a generic error like:

Client failed to connect: Server session was closed unexpectedly

This was hard to diagnose.

so i added a build-time error translation layer in client.py.
When client.call_tool(...) fails with a server-closed error for known optional servers (retriever, generation, evaluation, corpus), the CLI now raises a clear actionable message with install commands:
uv sync --extra
pip install "ultrarag[]"
Added explicit import guidance in evaluation.py:
If rouge-score is missing, it now raises a clear ModuleNotFoundError with installation instructions.

… and update fastmcp to improve optional dependency handling.
@xhd0728
Copy link
Copy Markdown
Collaborator

xhd0728 commented Apr 8, 2026

@hikariming Thanks for the PR! But I don't think this is correct as-is.

The main problem is that it treats a generic error (Server session was closed unexpectedly) as a missing dependency issue. But this error can also come from config problems, runtime errors, or other startup failures, so the current handling is too broad and may hide the real cause.

I think this kind of message should only be raised inside the specific server when a dependency is actually missing.

@xhd0728 xhd0728 closed this Apr 8, 2026
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.

2 participants