OLS-3126: Set LIGHTSPEED_AGENT_PROVIDER on sandbox templates#13
Conversation
|
@onmete: This pull request references OLS-3126 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
ca44e0a to
ecff357
Compare
|
@onmete: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
…LS-3150) Introduce GoogleCloudVertexRuntime (Claude, Gemini, OpenAI) so Vertex providers declare which SDK stack they use. Operator routing is a follow-up; this PR is API and CRD only. Co-authored-by: Cursor <cursoragent@cursor.com>
Use vendor-oriented values Anthropic, Google, and OpenAI instead of Claude, Gemini, and OpenAI SDK names. Co-authored-by: Cursor <cursoragent@cursor.com>
ecff357 to
41fc923
Compare
Map LLMProvider type to sandbox SDK runtime and set the matching model env var. For GoogleCloudVertex, use the new modelProvider field (from OLS-3150) to route to the correct SDK: Anthropic → claude (ANTHROPIC_MODEL, CLAUDE_CODE_USE_VERTEX=1) Google → gemini (GEMINI_MODEL) OpenAI → openai (OPENAI_MODEL) Other providers are unchanged: Anthropic/AWSBedrock → claude, OpenAI/AzureOpenAI → openai. Fix: OPENAI_MODEL for OpenAI/AzureOpenAI (was always ANTHROPIC_MODEL). Co-authored-by: Cursor <cursoragent@cursor.com>
41fc923 to
6718b32
Compare
|
|
||
| func vertexModelEnvVar(mp agenticv1alpha1.GoogleCloudVertexModelProvider) string { | ||
| switch mp { | ||
| case agenticv1alpha1.GoogleCloudVertexModelProviderAnthropic: |
There was a problem hiding this comment.
Why are we 3 different variable names for different providers just to map it back to single value in sandbox router? https://github.com/openshift/lightspeed-agentic-sandbox/blob/578aa4b5931571bc2eac05580e9faff09630887c/src/lightspeed_agentic/routes/__init__.py#L32
The only reason I've found was setting the default model, which could be simplified bu just setting the default based on the provider. Exposing 3 different vars for the same thing here feels like a leaky abtraction. IMO it would be better for the sandbox just to get MODEL_PROVIDER and MODEL, and doing the rest inside sandbox codebase.
| if err := setEnvVar(tmpl, "CLAUDE_CODE_USE_VERTEX", "1"); err != nil { | ||
| return fmt.Errorf("set CLAUDE_CODE_USE_VERTEX: %w", err) | ||
| if cfg.ModelProvider == agenticv1alpha1.GoogleCloudVertexModelProviderAnthropic { | ||
| if err := setEnvVar(tmpl, "CLAUDE_CODE_USE_VERTEX", "1"); err != nil { |
There was a problem hiding this comment.
Does the operator really need to know about CLAUDE_CODE_USE_VERTEX. This feels like sandbox-specifc thing. Doing it here creates high coupling beween the specific sandbox implementation and the operator (that IMO should not care how exactly the sandbox is setup)
Summary
LIGHTSPEED_AGENT_PROVIDERon derived sandbox templates fromLLMProvider.spec.typeGoogleCloudVertex, use the newmodelProviderfield (from OLS-3150 / PR OLS-3150: Add googleCloudVertex.modelProvider to LLMProvider CRD #14) to route to the correct SDKOPENAI_MODELfor OpenAI/AzureOpenAI (was alwaysANTHROPIC_MODEL)Depends on
googleCloudVertex.modelProvider)Mapping
Unblocks sandbox
/readyreadiness checks (OLS-3060) and correct OpenAI/Gemini SDK selection in production.Related
Test plan
make test(sandbox_templates tests for all provider types including Vertex Anthropic, Google, OpenAI)Made with Cursor