apache / apache/texera

HuggingFace inference operator: robustness cleanups in provider fallback and media-generation polling

Open
#7,203 3 comments 0 reactions 1 assignee Claimed by @juliethecao View on GitHub
Dominant language
Scala
Stars
314
Forks
187
Avg merge
1d 21h
Merged PRs (30d)
214

Description

### Task Summary

Two brittle spots in the operator's runtime provider-fallback / polling path.

### Context / checklist
- Replicate/Wavespeed poll handlers mutate the private `resp._content` and `resp.status_code` to synthesize a 502 - brittle; use a proper response object or a small result type instead.
- 400/422 are treated as "retryable", so a genuinely malformed payload is replayed against every provider before giving up (wasteful, and it obscures the real error).

File: `.../huggingFace/codegen/HuggingFaceCodegenBase.scala` (`_call_provider` poll handlers, `_post_with_fallback` retryable set).

### Required test
Per item, as addressed.

### Related
Part of the operator's fallback loop (see the provider-memoization task, #7202).

### Task Type

- [x] Refactor / Cleanup
- [ ] DevOps / Deployment / CI
- [ ] Testing / QA
- [ ] Documentation
- [ ] Performance
- [ ] Other

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.