Skip to content

Upgrade agent sandbox v0.5.2#442

Open
safiya2610 wants to merge 15 commits into
volcano-sh:mainfrom
safiya2610:upgrade-agent-sandbox-v0.5.2
Open

Upgrade agent sandbox v0.5.2#442
safiya2610 wants to merge 15 commits into
volcano-sh:mainfrom
safiya2610:upgrade-agent-sandbox-v0.5.2

Conversation

@safiya2610

@safiya2610 safiya2610 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Which issue(s) this PR fixes:
Fixes #438

Will resume my work tomorrow...

@volcano-sh-bot

Copy link
Copy Markdown
Contributor

[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 kevin-wangzefeng for approval. For more information see the Kubernetes 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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request upgrades the agent-sandbox dependency from v0.4.6 to v0.5.2, migrating the codebase from the v1alpha1 to the v1beta1 API. This includes updating controllers, helpers, and tests to align with the new API structures, updating documentation and scripts to use the consolidated sandbox-with-extensions.yaml manifest, and adding a proposal for Sandbox Resource Pool Management. The review feedback points out critical compilation errors in codeinterpreter_controller.go and workload_builder_test.go where PodTemplate is accessed directly instead of through SandboxBlueprint, a potential runtime panic in codeinterpreter_controller.go due to an unsafe pointer dereference, and a CLI flag syntax error in the getting-started documentation.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread pkg/workloadmanager/codeinterpreter_controller.go
Comment thread pkg/workloadmanager/workload_builder_test.go
Comment thread pkg/workloadmanager/codeinterpreter_controller.go Outdated
Comment thread docs/getting-started.md Outdated
@codecov-commenter

codecov-commenter commented Jul 17, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 78.66667% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.94%. Comparing base (3b19390) to head (2a2c5c2).
⚠️ Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
pkg/workloadmanager/codeinterpreter_controller.go 55.00% 9 Missing ⚠️
pkg/workloadmanager/k8s_client.go 44.44% 5 Missing ⚠️
pkg/workloadmanager/sandbox_controller.go 0.00% 1 Missing ⚠️
pkg/workloadmanager/server.go 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #442      +/-   ##
==========================================
+ Coverage   58.41%   59.94%   +1.53%     
==========================================
  Files          36       36              
  Lines        3463     3593     +130     
==========================================
+ Hits         2023     2154     +131     
+ Misses       1231     1219      -12     
- Partials      209      220      +11     
Flag Coverage Δ
unittests 59.94% <78.66%> (+1.53%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Upgrades AgentCube’s integration with kubernetes-sigs/agent-sandbox to v0.5.2, migrating internal references from the v1alpha1 API to v1beta1 across the workload-manager and E2E coverage, and refreshing docs/manifests to use the consolidated sandbox-with-extensions.yaml.

Changes:

  • Migrate agent-sandbox API usage from v1alpha1 to v1beta1 across controllers/handlers, tests, and E2E validation.
  • Update installation/E2E workflows to apply the single sandbox-with-extensions.yaml manifest.
  • Bump Kubernetes/controller-runtime and related Go dependencies; add a new sandbox pool management design proposal doc.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/e2e/run_e2e.sh Switch E2E install to sandbox-with-extensions.yaml.
test/e2e/e2e_test.go Update E2E tests to use agent-sandbox v1beta1 types.
pkg/workloadmanager/workload_builder.go Build Sandbox/SandboxClaim objects using v1beta1 schemas/fields.
pkg/workloadmanager/workload_builder_test.go Adjust tests for SandboxClaim spec field rename (TemplateRef → WarmPoolRef).
pkg/workloadmanager/sandbox_helper.go Update helpers to accept v1beta1 Sandbox types/conditions.
pkg/workloadmanager/sandbox_helper_test.go Update helper tests to v1beta1 types/condition constants.
pkg/workloadmanager/sandbox_controller.go Update controller watch/reconcile type to v1beta1 Sandbox.
pkg/workloadmanager/k8s_client.go Update dynamic-client create/get helpers to v1beta1 Sandbox/SandboxClaim types.
pkg/workloadmanager/handlers.go Update handler plumbing and annotation constants to v1beta1.
pkg/workloadmanager/handlers_test.go Update handler tests for v1beta1 types/constants (fixtures still need alignment).
pkg/workloadmanager/codeinterpreter_controller.go Update CodeInterpreter reconciliation logic to v1beta1 extension resources.
pkg/workloadmanager/codeinterpreter_controller_test.go Update controller tests to v1beta1 template/warm-pool schemas.
go.sum Dependency checksum updates for the upgrade.
go.mod Bump agent-sandbox, k8s libs, controller-runtime, and related deps.
docs/proposals/sandbox-pool-management/README.md Add new design proposal (sandbox resource pool management).
docs/getting-started.md Update install/upgrade instructions for agent-sandbox v0.5.2.
cmd/workload-manager/main.go Register v1beta1 schemes and update controller For() type.
Comments suppressed due to low confidence (1)

pkg/workloadmanager/handlers_test.go:323

  • This test constructs a v1beta1 SandboxClaim object but sets TypeMeta.APIVersion to v1alpha1. That inconsistency can break unstructured conversion / fake dynamic client behavior and makes the test exercise a different API version than the production code.
	claim := &extensionsv1beta1.SandboxClaim{
		TypeMeta: metav1.TypeMeta{
			APIVersion: "extensions.agents.x-k8s.io/v1alpha1",
			Kind:       types.SandboxClaimsKind,
		},

Comment thread pkg/workloadmanager/codeinterpreter_controller.go
Comment thread docs/getting-started.md Outdated
Comment thread pkg/workloadmanager/handlers_test.go
Comment thread pkg/workloadmanager/k8s_client.go
Comment thread pkg/workloadmanager/k8s_client.go
Copilot AI review requested due to automatic review settings July 17, 2026 10:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 5 comments.

Comment thread pkg/workloadmanager/codeinterpreter_controller.go Outdated
Comment thread pkg/workloadmanager/workload_builder.go
Comment thread pkg/workloadmanager/workload_builder.go
Comment thread pkg/workloadmanager/k8s_client.go
Comment thread pkg/workloadmanager/k8s_client.go
Copilot AI review requested due to automatic review settings July 17, 2026 10:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 3 comments.

Comment thread pkg/workloadmanager/workload_builder.go
Comment thread docs/getting-started.md
Comment thread go.mod Outdated
Copilot AI review requested due to automatic review settings July 17, 2026 10:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.

Comment thread docs/getting-started.md
Comment thread docs/getting-started.md
… for v1beta1 semantics and clarify Helm upgrades in docs
Copilot AI review requested due to automatic review settings July 17, 2026 11:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated 1 comment.

Comment thread pkg/workloadmanager/workload_builder.go Outdated
Copilot AI review requested due to automatic review settings July 17, 2026 11:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 17, 2026 16:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 27 changed files in this pull request and generated 4 comments.

Files not reviewed (5)
  • client-go/clientset/versioned/fake/clientset_generated.go: Generated file
  • client-go/informers/externalversions/factory.go: Generated file
  • client-go/informers/externalversions/internalinterfaces/factory_interfaces.go: Generated file
  • client-go/informers/externalversions/runtime/v1alpha1/agentruntime.go: Generated file
  • client-go/informers/externalversions/runtime/v1alpha1/codeinterpreter.go: Generated file

Comment thread client-go/informers/externalversions/factory.go
Comment thread client-go/informers/externalversions/factory.go Outdated
Copilot AI review requested due to automatic review settings July 17, 2026 16:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 27 changed files in this pull request and generated 3 comments.

Files not reviewed (5)
  • client-go/clientset/versioned/fake/clientset_generated.go: Generated file
  • client-go/informers/externalversions/factory.go: Generated file
  • client-go/informers/externalversions/internalinterfaces/factory_interfaces.go: Generated file
  • client-go/informers/externalversions/runtime/v1alpha1/agentruntime.go: Generated file
  • client-go/informers/externalversions/runtime/v1alpha1/codeinterpreter.go: Generated file

// WaitForCacheSync blocks until all started informers' caches were synced
// or the stop channel gets closed.
//
// Contextual logging: WaitForCacheSync should be used instead of WaitForCacheSync in code which supports contextual logging. It also returns a more useful result.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Signed-off-by: Safiya <[email protected]>
Copilot AI review requested due to automatic review settings July 17, 2026 16:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 27 changed files in this pull request and generated 2 comments.

Files not reviewed (5)
  • client-go/clientset/versioned/fake/clientset_generated.go: Generated file
  • client-go/informers/externalversions/factory.go: Generated file
  • client-go/informers/externalversions/internalinterfaces/factory_interfaces.go: Generated file
  • client-go/informers/externalversions/runtime/v1alpha1/agentruntime.go: Generated file
  • client-go/informers/externalversions/runtime/v1alpha1/codeinterpreter.go: Generated file

// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewAgentRuntimeInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer {
gvr := schema.GroupVersionResource{Group: "runtime", Version: "v1alpha1", Resource: "agentruntimes"}
// WaitForCacheSync blocks until all started informers' caches were synced
// or the stop channel gets closed.
//
// Contextual logging: WaitForCacheSync should be used instead of WaitForCacheSync in code which supports contextual logging. It also returns a more useful result.
Copilot AI review requested due to automatic review settings July 17, 2026 17:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 27 changed files in this pull request and generated 2 comments.

Files not reviewed (5)
  • client-go/clientset/versioned/fake/clientset_generated.go: Generated file
  • client-go/informers/externalversions/factory.go: Generated file
  • client-go/informers/externalversions/internalinterfaces/factory_interfaces.go: Generated file
  • client-go/informers/externalversions/runtime/v1alpha1/agentruntime.go: Generated file
  • client-go/informers/externalversions/runtime/v1alpha1/codeinterpreter.go: Generated file
Comments suppressed due to low confidence (1)

client-go/clientset/versioned/fake/clientset_generated.go:90

  • The fake clientset method is named IsWatchListSemanticsUnSupported, which doesn't follow Go naming conventions ("Unsupported") and may not satisfy the optional reflector interface check if it expects IsWatchListSemanticsUnsupported. Align the method (and its doc comment) to the canonical spelling to ensure watchlist semantics are correctly disabled in tests.

Comment thread hack/update-codegen.sh
Copilot AI review requested due to automatic review settings July 17, 2026 17:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 27 changed files in this pull request and generated 3 comments.

Files not reviewed (5)
  • client-go/clientset/versioned/fake/clientset_generated.go: Generated file
  • client-go/informers/externalversions/factory.go: Generated file
  • client-go/informers/externalversions/internalinterfaces/factory_interfaces.go: Generated file
  • client-go/informers/externalversions/runtime/v1alpha1/agentruntime.go: Generated file
  • client-go/informers/externalversions/runtime/v1alpha1/codeinterpreter.go: Generated file

// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewCodeInterpreterInformerWithOptions(client versioned.Interface, namespace string, options internalinterfaces.InformerOptions) cache.SharedIndexInformer {
gvr := schema.GroupVersionResource{Group: "runtime", Version: "v1alpha1", Resource: "codeinterpreters"}
// WaitForCacheSync blocks until all started informers' caches were synced
// or the stop channel gets closed.
//
// Contextual logging: WaitForCacheSync should be used instead of WaitForCacheSync in code which supports contextual logging. It also returns a more useful result.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade agent-sandbox to v0.5.2 or a later stable release

4 participants