Skip to content

Conversation

@Lincyaw
Copy link

@Lincyaw Lincyaw commented Nov 5, 2025

No description provided.

Copilot AI review requested due to automatic review settings November 5, 2025 03:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves error handling and logging for the vLLM async server by adding defensive error status code handling and error logging capabilities.

  • Added error logging when vLLM chat completion errors occur
  • Implemented defensive status code extraction with a fallback to 500
  • Removed unused import ChatCompletionResponsePatched

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


if isinstance(generator, ErrorResponse):
return JSONResponse(content=generator.model_dump(), status_code=generator.code)
status_code = getattr(generator, "code", None) or 500
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback to 500 may mask situations where generator.code is 0 or another falsy value. Consider explicitly checking for None: status_code = getattr(generator, 'code', None); status_code = status_code if status_code is not None else 500 or using status_code = getattr(generator, 'code', 500).

Suggested change
status_code = getattr(generator, "code", None) or 500
status_code = getattr(generator, "code", None)
status_code = status_code if status_code is not None else 500

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think this comment makes sense?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. It may be necessary to check the status code to see if it is used in AgentLightning and which code may be returned by verl.

return cls


logger = configure_logger()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be logger = logging.getLogger(__name__)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants