Skip to content

Remove unreachable streamed AI error-body branch - #5084

Open
jmtdev0 wants to merge 1 commit into
OpenFn:mainfrom
jmtdev0-open-source:fix/5083-unreachable-ai-error-body
Open

Remove unreachable streamed AI error-body branch#5084
jmtdev0 wants to merge 1 commit into
OpenFn:mainfrom
jmtdev0-open-source:fix/5083-unreachable-ai-error-body

Conversation

@jmtdev0

@jmtdev0 jmtdev0 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor
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

  1. Run MIX_ENV=test mix deps.get && mix deps.compile && mix test test/lightning/ai_assistant/ai_assistant_test.exs in the Docker development environment.
    • 112 tests, 0 failures.
  2. Run git diff --check.
  3. mix format --check-formatted was checked; it reports pre-existing formatting differences in other parts of these existing files, so no unrelated formatting changes were included.

Additional notes for the reviewer

  1. The change is intentionally scoped to deleting the unreachable body-message fallback and updating the three affected expectations.
  2. This change does not alter authorization behavior.
  3. The PR is ready for maintainer review.

AI Usage

Please disclose whether AI was used anywhere in this PR:

  • I have used Claude Code
  • I have used another model
  • I have not used AI

Pre-submission checklist

  • I have performed an AI review of my code.
  • Related authorization policies are not applicable to this error-message-only change.
  • I have updated the changelog.
  • I have ticked a box in AI usage in this PR.

@github-project-automation github-project-automation Bot moved this to New Issues in Core Aug 18, 2026
@jmtdev0

jmtdev0 commented Aug 18, 2026

Copy link
Copy Markdown
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.

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

Labels

None yet

Projects

Status: New Issues

Development

Successfully merging this pull request may close these issues.

Delete the unreachable branch that prefers Apollo's error text over ours

1 participant