Skip to content

fix: add missing workloadName for CodeInterpreter sandboxes#310

Open
HarshitPal25 wants to merge 1 commit intovolcano-sh:mainfrom
HarshitPal25:fix/codeinterpreter-workloadname-label
Open

fix: add missing workloadName for CodeInterpreter sandboxes#310
HarshitPal25 wants to merge 1 commit intovolcano-sh:mainfrom
HarshitPal25:fix/codeinterpreter-workloadname-label

Conversation

@HarshitPal25
Copy link
Copy Markdown

What this PR does

In buildSandboxByCodeInterpreter, the buildSandboxParams never sets the
workloadName field, causing the WorkloadNameLabelKey label to be empty
on all CodeInterpreter Sandbox objects.

The AgentRuntime path (buildSandboxByAgentRuntime) correctly sets
workloadName at line 274:

buildParams := &buildSandboxParams{
    namespace:    namespace,
    workloadName: name,  //  present here
    ...
}

But the CodeInterpreter path at line 425 does not:

buildParams := &buildSandboxParams{
    sandboxName: sandboxName,
    namespace:   namespace,
    // workloadName is MISSING 
    ...
}

Impact

CodeInterpreter sandboxes are missing the runtime.agentcube.io/workload-name label
This affects label-based queries and debugging for CodeInterpreter workloads

Fix

Added workloadName: codeInterpreterName to match the AgentRuntime pattern.

In buildSandboxByCodeInterpreter, the buildSandboxParams never set the
workloadName field, causing the WorkloadNameLabelKey label to be empty
on all CodeInterpreter Sandbox objects. The AgentRuntime path
(buildSandboxByAgentRuntime) correctly sets workloadName.

This fix ensures CodeInterpreter sandboxes carry the same
WorkloadNameLabelKey label as AgentRuntime sandboxes, which is used
for label-based queries and debugging.

Signed-off-by: HarshitPal25 <harshit13082006@gmail.com>
Copilot AI review requested due to automatic review settings May 9, 2026 19:05
@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 yaozengzeng 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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes missing runtime.agentcube.io/workload-name labeling for CodeInterpreter sandboxes generated by the Workload Manager, aligning CodeInterpreter sandbox construction with the existing AgentRuntime path.

Changes:

  • Populate buildSandboxParams.workloadName in buildSandboxByCodeInterpreter so WorkloadNameLabelKey is set on created Sandbox objects.

Comment on lines 425 to 429
buildParams := &buildSandboxParams{
sandboxName: sandboxName,
namespace: namespace,
workloadName: codeInterpreterName,
sessionID: sessionID,
@codecov-commenter
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 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 47.74%. Comparing base (524e55e) to head (f0039a5).
⚠️ Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
pkg/workloadmanager/workload_builder.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     #310      +/-   ##
==========================================
+ Coverage   47.57%   47.74%   +0.17%     
==========================================
  Files          30       30              
  Lines        2819     2855      +36     
==========================================
+ Hits         1341     1363      +22     
- Misses       1338     1344       +6     
- Partials      140      148       +8     
Flag Coverage Δ
unittests 47.74% <0.00%> (+0.17%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Contributor

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

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 updates the buildSandboxByCodeInterpreter function to include the workloadName in the sandbox build parameters. However, the feedback indicates that the implementation is incomplete as it misses applying the WorkloadNameLabelKey label to the warm pool path, specifically for the simpleSandbox and SandboxClaim objects.

buildParams := &buildSandboxParams{
sandboxName: sandboxName,
namespace: namespace,
workloadName: codeInterpreterName,
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.

medium

While this change correctly addresses the missing workloadName for the direct sandbox creation path, the fix appears incomplete based on the PR description. The WorkloadNameLabelKey label is still missing in the warm pool path (when WarmPoolSize > 0). Specifically, the simpleSandbox object created at line 384 and the SandboxClaim created at line 371 should also include the WorkloadNameLabelKey label to ensure consistency across all CodeInterpreter workloads.

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.

4 participants