Week 9-10: Integration testing + fix chat stream error handling - #559
Open
ashike24 wants to merge 10 commits into
Open
Week 9-10: Integration testing + fix chat stream error handling#559ashike24 wants to merge 10 commits into
ashike24 wants to merge 10 commits into
Conversation
Wraps the OpenAI responses.create() call in ChatAssistantBase.stream_response() with a try/except. Previously any failure (auth error, timeout, transient outage) crashed the SSE stream unhandled, leaving the user's browser stuck on 'Thinking...' forever with no feedback. Now logs the error and streams a clean user-facing message instead. Found during Week 9-10 integration testing. Verified via live browser test and full LLM test suite (82 passed, 0 regressions).
Author
|
Note for reviewer: this PR shows as including changes from #521 (challenge library) and #532 (rate limiting) since neither has been merged into main yet - this branch was built on top of my existing work. Once #521/#532 are reviewed and merged, this diff will narrow down to just the Week 9-10 changes (the chat.py bug fix). Happy to rebase/split this differently if you'd prefer - just let me know. |
Author
|
Closing this in favor of a single combined final submission: #567, which includes the chat stream fix from this PR along with everything else from the program. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Week 9-10 integration testing pass across existing deliverables (challenge library, rate limiting). No new features — this PR validates prior work and fixes one real bug found along the way.
What's in this PR
ChatAssistantBase.stream_response()had no error handling around the OpenAIresponses.create()call. Any LLM failure (auth, timeout, outage) crashed the SSE stream silently, leaving the user stuck on "Thinking..." forever. Now wrapped in try/except, logs the error, and streams a clean user-facing message instead.Testing done
AGENT_RATE_LIMIT_MAX=10/AGENT_RATE_LIMIT_WINDOW_SECONDS=60)Notes for reviewer
OPENAI_API_KEY(pre-existing gap, documented since Week 7-8)