Remove unreachable streamed AI error-body branch - #5084
Open
jmtdev0 wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
CI note: The CircleCI lint job is currently failing only at hex.audit because the repository dependency cowlib 2.19.0 is flagged for CVE-2026-43971. This PR changes only lib/lightning/ai_assistant/ai_assistant.ex and test/lightning/ai_assistant/ai_assistant_test.exs; it does not modify mix.lock or dependency versions. The other lint stages (format, Credo, Sobelow, and deps.audit) passed, and the compile, Dialyzer, Elixir, and JavaScript checks are green. I have left the dependency advisory out of this focused PR because resolving it would be an unrelated dependency change. |
jmtdev0
marked this pull request as ready for review
August 18, 2026 21:22
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.
AI Disclaimer
This pull request was primarily developed with assistance from OpenAI Codex (GPT-5.6 Luna Max), an AI coding agent. For this PR, Codex analyzed issue #5083, inspected the relevant OpenFn Lightning code and tests, implemented the focused fix, and ran the affected test suite under the supervision of jmtdev0.
Human involvement in this PR was very low.
If you do not agree with the use of AI assistance or with the level of human involvement in this PR, please feel free to disregard it, close it, or request changes. I will fully respect that decision.
Description
This PR removes the unreachable error_message_from_body/1 branch from AI assistant error handling. Assistant calls now stream responses, so the response body is lazy and cannot be indexed as the legacy decoded map. Failed requests now use the local HTTP status message consistently.
Closes #5083
Validation steps
Additional notes for the reviewer
AI Usage
Please disclose whether AI was used anywhere in this PR:
Pre-submission checklist