Skip to content

Improve SSE error handling#1

Open
HeadBro1 wants to merge 1 commit into
owenliang:mainfrom
HeadBro1:main
Open

Improve SSE error handling#1
HeadBro1 wants to merge 1 commit into
owenliang:mainfrom
HeadBro1:main

Conversation

@HeadBro1

Copy link
Copy Markdown

Summary

  • Validate username before using it as an AgentScope session id.
  • Return visible SSE error messages so the browser does not end with a blank response.
  • Surface missing API_KEY configuration to the frontend instead of leaving the chat response blank.
  • Add a lightweight /health endpoint for service checks.

Why

The current /stream handler only prints agent exceptions on the server and then closes the stream. In the browser this shows up as a generic EventSource error or blank assistant response, which makes common setup/runtime problems difficult to diagnose. The handler also accepts arbitrary username values and passes them directly to JSONSession, so session ids are not constrained before being used for persistence.

Validation

  • python3 -m py_compile chatbot.py

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.

1 participant