[BUG FIX] [MER-5820] Harden DOT GenAI failure handling - #6765
Open
nicocirio wants to merge 3 commits into
Open
Conversation
Contributor
Contributor
AI Review — uiNo issues found |
Contributor
AI Review — performanceNo issues found |
Contributor
AI Review — elixirNo issues found |
Contributor
AI Review — securityNo issues found |
nicocirio
marked this pull request as ready for review
August 11, 2026 13:23
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.
Jira
https://eliterate.atlassian.net/browse/MER-5820
Summary
Fixes DOT failure paths that could leave students on an infinite loading spinner.
429 insufficient_quota), without provider bodies, prompts, tool arguments, or credentials.Failure mode and fix
A bad encrypted credential previously reached provider execution (or silently used the global OpenAI key), while a stalled task could outlive the UI watchdog. The UI could then re-enable submission and receive stale stream events from the old task. This change fails invalid credentials explicitly, bounds the task lifecycle, and ignores stale events.
Video
Video: DOT tested with an OpenAI API key that has no remaining credits. The request fails gracefully, the chat displays the generic error and correctly re-enables input for another message. At the same time, the server logs the failure safely and actionably as
429 insufficient_quota, without exposing credentials or sensitive content.Screen.Recording.2026-08-11.at.9.52.36.AM.mov
Validation
mix formatmix compileyarn --cwd assets run formatyarn --cwd assets run check-typesyarn --cwd assets run deploymix test test/oli/gen_ai/dialogue/server_test.exs test/oli/gen_ai/execution_test.exs test/oli/gen_ai/completions_test.exs test/oli/gen_ai/completions/open_ai_compliant_provider_test.exs test/oli/encrypted/binary_test.exs test/oli_web/live/dialogue/window_live_test.exs(66 tests, 0 failures)