Conversation
Greptile SummaryThis PR begins a migration of all AI provider implementations (OpenAI, Anthropic, Azure, Bedrock, Vertex) from hand-rolled HTTPoison/Poison HTTP handling to the Key items to verify before merging:
Confidence Score: 2/5
|
| Filename | Overview |
|---|---|
| lib/console/ai/provider/openai.ex | Core OpenAI provider rewritten to use ReqLLM; contains a logic bug where guess_protocol receives an atom field key instead of the actual model string, breaking auto-detection of gpt-5 → Responses API for custom base URLs. |
| lib/console/ai/provider/azure.ex | Azure provider rewritten to use ReqLLM directly; proxy now returns an error (breaking change), stream support added, and a typo exists in the private noramlize_url function name. |
| lib/console/ai/provider/base.ex | New shared ReqLLM adapter layer; handles message conversion, tool wrapping, result parsing, and streaming callback. Logic is straightforward and consistent across providers. |
| lib/console/ai/provider/anthropic.ex | Anthropic provider dramatically simplified via ReqLLM; default model bumped to claude-4-5-sonnet-latest (from claude-3-5-sonnet-latest) and context window now dynamically looked up from LLMDB instead of being hardcoded. |
| lib/console/ai/provider/vertex.ex | Vertex provider rewritten to use ReqLLM with google-vertex: prefix; default model changed from gemini-2.5-flash to claude-sonnet-4-5@20250929, which is a potentially breaking default for existing Vertex users. |
| lib/console/ai/provider/bedrock.ex | Bedrock provider rewritten to use ReqLLM with bedrock: prefix; AWS credentials now handled explicitly or via ExAws fallback; proxy removed. |
| go/controller/api/v1alpha1/deploymentsettings_types.go | New OpenAISettings type added with Method field; Nexus attribute-mapping code is commented out but NexusSettings struct and its CRD schema entry remain active, creating an inconsistent half-removed state. |
| lib/console/ai/stream.ex | New publish/1 callback added for ReqLLM streaming; index field added to track position within a message. Logic is correct assuming the stream process state is always initialized before use. |
| lib/console/ai/provider.ex | context_window/1 now accepts a client argument (:default or :tool) and keys the cache accordingly, allowing different window sizes for different client types. |
| lib/console/schema/deployment_settings.ex | Adds OpenAIMethod enum and method field to the OpenAI settings embedded schema; dedicated openai_changeset replaces the generic ai_api_changeset. |
| mix.exs | Adds req_llm ~> 1.7 dependency; rest of the file unchanged. |
Comments Outside Diff (4)
-
lib/console/ai/provider/openai.ex, line 88-95 (link)guess_protocolreceives atom key instead of model stringguess_protocol(model, method)is called withmodelas an atom field key (e.g.:model,:tool_model) passed from the callers — not the actual model string. The third clausedefp guess_protocol("gpt-5" <> _, _)can therefore never match (an atom won't match a binary pattern), so auto-detection of gpt-5 models to use the Responses API will silently fall through to"openai_chat"even whenmethodis:auto. The fix is to pass the resolved model string instead: -
lib/console/ai/provider/azure.ex, line 85-87 (link)Typo in private function name
noramlize_urlis misspelled — the lettersrandmare transposed.The call site on line 74 (
noramlize_url(base_url)) would need to be updated as well. -
go/controller/api/v1alpha1/deploymentsettings_types.go, line 719-733 (link)Dead commented-out code should be removed
A large block of Nexus attribute-mapping code has been commented out rather than deleted.
NexusSettingsstill has a live struct definition (line 1027), aToken()method, aDeepCopyIntoin the generated code, and a field onAISettings(line 468), yet the attributes path is silently skipped. This creates a confusing half-removed state: the CRD schema acceptsnexusconfig but it will never be forwarded to the API.Consider either removing the dead code and the still-unused
NexusSettingsstruct entirely, or leaving a clear// TODOwith a tracking issue if this is intentionally deferred. -
lib/console/graphql/deployments/settings.ex, line 119 (link)"chart completions" should be "chat completions"
The description text says "chart completions" which is a typo. The same typo is present in multiple generated/schema files:
schema/schema.graphql,assets/src/generated/graphql.ts,go/client/models_gen.go, and the CRD YAML files. Fixing it here in the source definition will naturally propagate to the generated files on the next codegen run.
Last reviewed commit: "drop handwritten sse..."
8640438 to
e94cd91
Compare
6856612 to
b87b9e4
Compare
|
@greptileai (also ignore the nexus deprecation, that's going to need work separately) |
|
Got it, that makes sense. The nexus deprecation is a separate concern from the ReqLLM migration work in this PR, so it's fine to leave that for later. |
0d66c97 to
2896d7a
Compare
2896d7a to
b1b172a
Compare
b3c61a8 to
d826288
Compare
1fe519b to
66c34da
Compare
This should reimplement our ai provider behaviors using reqllm to offload response parsing and other annoyances. This is going to require a decent amount of e2e testing before merge but is ultimately the better solve here.
dc865e9 to
fb8abfa
Compare
fb8abfa to
b1dac30
Compare
11da0b0 to
26b1b4d
Compare
This should reimplement our ai provider behaviors using reqllm to offload response parsing and other annoyances. This is going to require a decent amount of e2e testing before merge but is ultimately the better solve here.
Test Plan
unit tests updated
Checklist
Plural Flow: console