Skip to content

OLS-3126: Set LIGHTSPEED_AGENT_PROVIDER on sandbox templates#13

Draft
onmete wants to merge 3 commits into
openshift:mainfrom
onmete:ols-3126-sandbox-provider-env
Draft

OLS-3126: Set LIGHTSPEED_AGENT_PROVIDER on sandbox templates#13
onmete wants to merge 3 commits into
openshift:mainfrom
onmete:ols-3126-sandbox-provider-env

Conversation

@onmete
Copy link
Copy Markdown
Contributor

@onmete onmete commented May 20, 2026

Summary

  • Set LIGHTSPEED_AGENT_PROVIDER on derived sandbox templates from LLMProvider.spec.type
  • For GoogleCloudVertex, use the new modelProvider field (from OLS-3150 / PR OLS-3150: Add googleCloudVertex.modelProvider to LLMProvider CRD #14) to route to the correct SDK
  • Fix model env var: OPENAI_MODEL for OpenAI/AzureOpenAI (was always ANTHROPIC_MODEL)

Depends on

Mapping

LLMProvider.spec.type modelProvider LIGHTSPEED_AGENT_PROVIDER Model env
Anthropic claude ANTHROPIC_MODEL
GoogleCloudVertex Anthropic claude ANTHROPIC_MODEL
GoogleCloudVertex Google gemini GEMINI_MODEL
GoogleCloudVertex OpenAI openai OPENAI_MODEL
AWSBedrock claude ANTHROPIC_MODEL
OpenAI openai OPENAI_MODEL
AzureOpenAI openai OPENAI_MODEL

Unblocks sandbox /ready readiness 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

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 20, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 20, 2026

@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.

Details

In response to this:

Summary

  • Set LIGHTSPEED_AGENT_PROVIDER on derived sandbox templates from LLMProvider.spec.type
  • Fix model env var: OPENAI_MODEL for OpenAI/AzureOpenAI (was always ANTHROPIC_MODEL)

Mapping

LLMProvider.spec.type LIGHTSPEED_AGENT_PROVIDER Model env
Anthropic claude ANTHROPIC_MODEL
GoogleCloudVertex claude ANTHROPIC_MODEL
AWSBedrock claude ANTHROPIC_MODEL
OpenAI openai OPENAI_MODEL
AzureOpenAI openai OPENAI_MODEL

Unblocks sandbox /ready readiness checks (OLS-3060) and correct OpenAI SDK selection in production.

Related

Test plan

  • make test (sandbox_templates tests for Anthropic, Vertex, Bedrock, OpenAI, AzureOpenAI)

Made with Cursor

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.

@openshift-ci openshift-ci Bot requested review from harche and raptorsun May 20, 2026 14:06
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 20, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign joshuawilson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@onmete onmete force-pushed the ols-3126-sandbox-provider-env branch from ca44e0a to ecff357 Compare May 20, 2026 14:11
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 20, 2026

@onmete: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/unit ecff357 link true /test unit
ci/prow/generate ecff357 link true /test generate

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@onmete onmete marked this pull request as draft May 21, 2026 05:57
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 21, 2026
…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>
@onmete onmete force-pushed the ols-3126-sandbox-provider-env branch from ecff357 to 41fc923 Compare May 21, 2026 06:56
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>
@onmete onmete force-pushed the ols-3126-sandbox-provider-env branch from 41fc923 to 6718b32 Compare May 21, 2026 07:17

func vertexModelEnvVar(mp agenticv1alpha1.GoogleCloudVertexModelProvider) string {
switch mp {
case agenticv1alpha1.GoogleCloudVertexModelProviderAnthropic:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants