feat(llm): complete gated OpenAI-compatible HTTP provider - #796
Conversation
matedev01
left a comment
There was a problem hiding this comment.
LGTM — completes the optional OpenAI-compatible provider with a real reqwest-based HTTP/HTTPS transport (JSON + SSE streaming), leaving the local raw TCP client untouched. Verified independently, not just from the PR description: resolve_bearer_token re-reads the env var fresh on every request (not cached at startup) so revoking a credential takes effect immediately; parse_openai_compatible_base_url rejects non-HTTP(S) schemes with a test; error paths route through sanitize_error_detail/redact_reqwest_error and Debug redacts the literal-credential variant, all with dedicated tests. Only dependency change is enabling reqwest's existing 'stream' feature, no new crate. Closes #795, part of #569 (M2-C). Off by default, no change to the local provider path. Verified: clippy -D warnings clean, provider tests (15) pass, fmt clean.
Summary
Complete the optional OpenAI-compatible provider with a real HTTP/HTTPS transport, runtime credential checks, and fail-closed gate behavior. Add loopback wire tests and deployment documentation so the remote path is usable without changing the local runtime default.
Closes #795, #569
Changes
reqwest, including JSON and SSE streaming responses.chat/completionsand reject non-HTTP(S) schemes.Real Behavior Proof
Tested profile / hardware (check all that apply):
jetsonraspberry_piportable_sbclaptopmacWhat I ran
Linux x86_64 laptop, Rust 1.97.1. Jetson hardware was not available:
What I observed
genie-coreandgenie-ctlno-default-features clippy and test axis passed.provider_testtests and 8provider_config_testtests./v1/chat/completionspath, bearer authorization, model, messages, token budget, response format, and stream flag.This was not run against a real remote provider or on Jetson hardware because neither was available. The loopback server exercises the same HTTP request/response boundary without sending data or requiring a real credential. It does not verify provider-specific compatibility, public TLS, Jetson networking, or aarch64 execution; those remain validation gaps for reviewer or CI follow-up.
Test plan
/v1base path, model, credential environment-variable name, and the required remote-provider opt-in.Notes for reviewers
reqweststreamfeature adds the expected transitive lockfile entries used by streaming response bodies.