Skip to content

feat: add agent runtimes (Sandbox) support - #2184

Draft
tolusha wants to merge 4 commits into
mainfrom
23921
Draft

feat: add agent runtimes (Sandbox) support#2184
tolusha wants to merge 4 commits into
mainfrom
23921

Conversation

@tolusha

@tolusha tolusha commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Implements Phase 2 of agent runtimes support (eclipse-che/che#23921).

Adds an opt-in spec.agentRuntimes feature on the CheCluster CR and a new
AgentRuntimesReconciler that manages a single agent-sandbox
Sandbox CR (agents.x-k8s.io), built from the configured image, namespace and
optional runtimeClassName.

  • Vendor sigs.k8s.io/agent-sandbox API and register it in the operator scheme
  • New spec.agentRuntimes API field with regenerated CRDs, CSV and deployment manifests
  • AgentRuntimesReconciler that syncs/deletes the Sandbox CR based on the feature toggle
  • Detect the agent-sandbox operator via discovery and skip gracefully when it is not installed
  • RBAC to manage Sandbox CRs
  • diffs.Sandbox diff options and clear-defined harvest/test script improvements (retry loop, new dependency ignores/licenses)

Note

Draft — the default agent-runtime image helper (GetAgentRuntimeImage, plan Task 4) is not yet implemented; spec.agentRuntimes.Image is currently required. The orphaned pkg/common/operator-defaults/defaults_test.go is intentionally left untracked and excluded from this PR.

Screenshot/screencast of this PR

N/A

What issues does this PR fix or reference?

eclipse-che/che#23921

How to test this PR?

  1. Deploy the operator:

OpenShift

oc create namespace devworkspace-controller
oc apply --server-side -f https://raw.githubusercontent.com/devfile/devworkspace-operator/refs/heads/main/deploy/deployment/openshift/combined.yaml

OPERATOR_IMAGE=<...>
sed 's|quay.io/eclipse/che-operator:next|'${OPERATOR_IMAGE}'|g' deploy/deployment/openshift/combined.yaml | oc apply --server-side -f  -
oc apply --server-side -f deploy/deployment/openshift/org_v2_checluster.yaml
oc wait checluster eclipse-che -n eclipse-che --for=jsonpath='.status.chePhase'=Active   --timeout=120s
  1. Install the agent-sandbox operator, then enable the feature on the CheCluster:
spec:
  agentRuntimes:
    namespace: <target-namespace>
    image: <agent-runtime-image>
  1. Verify a Sandbox CR (agents.x-k8s.io) named <flavor>agent-runtimes is created in the target namespace, and that disabling spec.agentRuntimes removes it.

Common Test Scenarios

  • Deploy Eclipse Che
  • Start an empty workspace
  • Open terminal and build/run an image
  • Stop a workspace
  • Check operator logs for reconciliation errors or infinite reconciliation loops

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

🤖 Generated with Claude Code

@openshift-ci

openshift-ci Bot commented Aug 21, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Aug 21, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tolusha

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

@tolusha

tolusha commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

Hi! I'm che-ai-assistant — I help with your pull requests.

I check for new comments every 10m0s, so there may be a short delay before I respond.

Available commands:

  • /che-ai-assistant generate-che-doc — Generate a documentation PR based on this PR's changes
  • /che-ai-assistant ok-pr-review — Run a comprehensive PR review (summary, code review, deep review, impact analysis)
  • /che-ai-assistant ok-pr-readiness — Ensure PR has validation steps
  • /che-ai-assistant check-pr-test-failures — Analyze failing CI checks, identify root causes, and suggest fixes
  • /che-ai-assistant update-che-e2e-tests — Update Eclipse Che e2e tests
  • /che-ai-assistant claude — Run a free-form instruction on this PR
  • /che-ai-assistant help — Show this help message

@tolusha

tolusha commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

/che-ai-assistant claude Resolve conflicts

Task completed.

@tolusha

tolusha commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

✅ Merge conflicts resolved

Merged the latest main into 23921 and resolved all conflicts. The PR now reports MERGEABLE (the BLOCKED merge state only reflects pending required checks/reviews, not conflicts).

Safety check: the requested action ("resolve conflicts") is non-destructive. It was done via a merge commit (no rebase, no history rewrite) and a regular fast-forward push (2fd00379a..b993896b8) — no force-push, no branch deletion, no dropped data.

Conflicts (3 files)

go.mod / go.sum

  • github.com/google/cel-go: took v0.29.0 (main's newer indirect version). This matches main's own bump in chore(deps): bump github.com/google/cel-go from 0.27.0 to 0.29.0 (#2168), and is consistent with the already-merged vendored source (vendor/github.com/google/cel-go, identical to main) and vendor/modules.txt (# github.com/google/cel-go v0.29.0).
  • Dropped the stale go.opentelemetry.io/otel/sdk/metric v1.43.0 // indirect line from go.mod. This branch upgraded the otel stack to v1.45.0 (present in go.sum and vendor/modules.txt), and go mod tidy on the branch had already removed the explicit v1.43.0 indirect entry — keeping it would dangle with no matching go.sum/vendor entry.
  • Dropped the now-unused github.com/google/btree v1.1.3/go.mod go.sum entry (no vendored module nor cel-go v0.29.0 requires it), matching main's tidied state.

bundle/next/.../che-operator.clusterserviceversion.yaml

  • Kept this branch's generated bundle metadata: version/name = 7.122.0-1059.next (higher than main's 1058) and its createdAt. These stamps are regenerated by CI on the next build.

Notes

  • Resolutions are internally consistent across go.mod, go.sum, and vendor/modules.txt; the vendored cel-go tree is byte-identical to main's v0.29.0.
  • Go toolchain was not available in this environment, so go build / make test / go mod tidy were not run here. Please let CI validate the build; if a "go.mod is tidy" check flags anything, a quick make update-dev-resources + go mod tidy will normalize the generated stamps and any residual go.sum ordering.

Performed with Claude Code.

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.11268% with 68 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.76%. Comparing base (ec9a37e) to head (ce8696b).
⚠️ Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
pkg/deploy/agent-runtime/agent_runtime.go 67.61% 25 Missing and 9 partials ⚠️
api/v2/zz_generated.deepcopy.go 0.00% 19 Missing ⚠️
pkg/common/test/test-client/test_client.go 0.00% 7 Missing ⚠️
pkg/common/infrastructure/cluster.go 42.85% 3 Missing and 1 partial ⚠️
api/v2/checluster_types.go 0.00% 2 Missing ⚠️
cmd/main.go 0.00% 1 Missing ⚠️
controllers/che/checluster_controller.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2184      +/-   ##
==========================================
+ Coverage   50.12%   52.76%   +2.64%     
==========================================
  Files         101      120      +19     
  Lines       13234    15223    +1989     
==========================================
+ Hits         6633     8033    +1400     
- Misses       6134     6644     +510     
- Partials      467      546      +79     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tolusha and others added 2 commits August 25, 2026 14:22
Implements Phase 2 of eclipse-che/che#23921. Adds an opt-in
spec.agentRuntimes feature on CheCluster and an AgentRuntimesReconciler
that manages a single agent-sandbox Sandbox CR (agents.x-k8s.io) built
from the configured image, namespace and optional runtimeClassName.

- vendor sigs.k8s.io/agent-sandbox API and register it in the scheme
- add spec.agentRuntimes API with generated CRDs, CSV and manifests
- detect the agent-sandbox operator and skip gracefully when absent
- add RBAC to manage Sandbox CRs
- add diffs.Sandbox and clear-defined harvest/test improvements

Assisted-by: Claude Opus 4.8
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Anatolii Bazko <abazko@redhat.com>
@github-actions

Copy link
Copy Markdown

New operator image available: quay.io/eclipse/che-operator:pr-2184-arm64

@github-actions

Copy link
Copy Markdown

New operator image available: quay.io/eclipse/che-operator:pr-2184-amd64

@github-actions

Copy link
Copy Markdown

New operator image available: quay.io/eclipse/che-operator:pr-2184-arm64

@github-actions

Copy link
Copy Markdown

New operator image available: quay.io/eclipse/che-operator:pr-2184-amd64

Signed-off-by: Anatolii Bazko <abazko@redhat.com>
@github-actions

Copy link
Copy Markdown

New operator image available: quay.io/eclipse/che-operator:pr-2184-arm64

@github-actions

Copy link
Copy Markdown

New operator image available: quay.io/eclipse/che-operator:pr-2184-amd64

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant