Drop our copy of Tesla's Finch adapter now that upstream carries the fix
Nobody has claimed this yet.
- Dominant language
- Elixir
- Stars
- 296
- Forks
- 86
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 50
Description
We carry a copy of Tesla's Finch adapter in lib/lightning/tesla/adapter/finch.ex. It is there because upstream threw away the reason a streamed response stopped, so a hung Apollo, a severed connection and a genuinely short answer all looked identical to us, and every AI chat failure told the user the same thing whatever had actually happened.
That is fixed upstream now. Tesla 1.21.1 raises with the reason while the body is being consumed, and it also passes the request timeout through to Finch, which the 1.18.3 we are pinned to drops. Between them that is the whole reason the copy exists, so it can go.
It is not a straight swap. Upstream raises where we stash the reason and read it back once the stream has been consumed, so the places in the AI assistant that ask why a stream stopped have to rescue instead. The adapter's own tests go with the module, and the coverage exclusion we added for it in codecov.yml can come out at the same time.
Worth doing carefully rather than quickly. We are three minor versions behind, and Tesla handles every outbound call in Lightning rather than only the ones to Apollo, so the upgrade wants its own look rather than riding along with something else.
I did check 1.21.1 behaves the way we need before writing this, against a real socket through the SSE middleware: a stall past the receive timeout and a mid-stream hangup now arrive as different reasons, and a clean end still just finishes.
Reported upstream as tesla#912, fixed in tesla#913. The copy came in with #5073.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/lightning/tesla/adapter/finch.ex and its adapter tests, then find the AI assistant call sites that read why a stream stopped. Review the Tesla 1.21.1 upgrade and its streamed-response and request-timeout behavior before changing the dependency. Done means the local copy, its tests, and the codecov.yml exclusion are removed while distinct stream failure reasons and timeouts remain available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100