Consolidate and clarify SandboxInfo fields in session store

Open
#531 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go, redis
Domain
backend

Research direction

Start with pkg/common/types/sandbox.go and the comment in #521, then trace how SandboxInfo is stored and consumed by workloadmanager and router. Compare the in-record annotations approach with the separate-key option, including Redis and Valkey support and cleanup. Done means the field boundary and compatibility plan are agreed on; the issue does not specify a standalone implementation or test.

Written by the indexing model from the issue text.

Description

What would you like to be added:

Following up on the comment in #521 about revising SandboxInfo (pkg/common/types/sandbox.go) as the architecture evolves.

SandboxInfo currently has 11 flat fields on main, and upcoming work like E2B compatibility (#257 / #520) needs a few more. Before adding fields ad hoc, I'd like to align on how SandboxInfo should be cleaned up and where protocol-specific state should live:

  • K8s resource vs. AgentCube workload identity: Kind (Sandbox / SandboxClaim) sits next to WorkloadKind (AgentRuntime / CodeInterpreter), alongside Name, SandboxNamespace, SandboxID (K8s UID, currently only used for logging/response), and SessionID. Separating the K8s resource target from the workload source (e.g. pairing WorkloadKind with WorkloadName, and checking whether SandboxID still needs to be persisted) would make this much clearer.
  • PodIP vs. EntryPoints: EntryPoints[i].Endpoint currently embeds <podIP>:<port>. Making PodIP a first-class field avoids parsing EntryPoints[0].Endpoint when callers need direct pod access (such as E2B's envd or custom ports), and lets us simplify EntryPoints later if needed.
  • Protocol extensions and tokens: instead of adding protocol-specific top-level fields to SandboxInfo, we can keep a generic system Annotations map[string]string (with namespaced keys) separate from user-supplied Metadata map[string]string, treating SandboxInfo strictly as an internal store record (never returned raw in HTTP responses or logged verbatim). The alternative is storing protocol state under a separate key, which avoids touching SandboxInfo but requires generic KV support in store.Store (Redis + Valkey), an extra RTT on the proxy hot path, and dual-key GC cleanup.
  • Compatibility: renaming or nesting existing JSON fields in Redis/Valkey affects rolling upgrades between workloadmanager and router, so any structural refactor should be handled separately from feature PRs. For E2B in the meantime, we only need minimal generic additions (WorkloadName, PodIP, Metadata, Annotations).

Why is this needed:

Aligning on the SandboxInfo boundary now avoids ad-hoc field growth as new features land, and gives us a clean plan for consolidating the existing fields.

cc @zhzhuang-zju

Dominant language
Go
Stars
176
Forks
95
Avg merge
5d 18h
Merged PRs (30d)
9

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from volcano-sh/agentcube

All issues in volcano-sh/agentcube

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.