Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## integration/0.7-clients-inspect #336 +/- ##
==================================================================
Coverage ? 66.1%
==================================================================
Files ? 1482
Lines ? 121272
Branches ? 86139
==================================================================
Hits ? 80200
Misses ? 36637
Partials ? 4435
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…list
Allow callers to attach optional key/value string labels to VMs at
creation time, inherit or override them on fork, and return them on
every SandboxInfo entry in /vms/list and /vms/{id}/info so external
orchestrators and garbage collectors can identify their own VMs.
- capsem-api / capsem-service / OpenAPI: add optional labels
(Option<HashMap<String, String>>) to ProvisionRequest, ForkRequest,
SandboxInfo, VmInstance, SessionCreationParams, and PersistentVmEntry,
validated server-side via naming::validate_vm_labels (<= 64 entries,
keys reuse validate_vm_name: 1..=64 ASCII chars starting with
[A-Za-z0-9] and containing only [A-Za-z0-9_-]; values <= 255 UTF-8
bytes with no control chars) and normalized via
naming::non_empty_labels so {} is treated identically to None.
- Fork inheritance: /vms/{id}/fork inherits the source VM's labels when
ForkRequest.labels is omitted/null, replaces them when a non-empty map
is provided, and clears them when {} is provided.
- List cache fingerprint: include running and inactive VM labels in
list_response_fingerprint via append_labels_fingerprint so label
differences invalidate cached /vms/list responses.
- SDKs (Python, Rust, TypeScript): thread optional labels through
Hypervisor.create / CreateOptions and VM.fork / ForkOptions and
regenerate OpenAPI models across all three SDKs.
- CLI & TUI: add repeatable -l / --label KEY=VALUE to capsem create and
capsem fork, and display labels in the TUI session detail pane.
tholop
force-pushed
the
feat/sdk-vm-labels
branch
from
October 8, 2026 13:07
bc9bdb5 to
2514565
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
labels(Option<HashMap<String, String>>) toProvisionRequest(POST /vms/create),ForkRequest(POST /vms/{id}/fork),SandboxInfo(GET /vms/listandGET /vms/{id}/info),VmInstance,SessionCreationParams, andPersistentVmEntry.ForkRequest) inherits the source VM's labels whenlabelsis omitted/null, replaces them when a non-empty map is provided, and clears them when{}is passed.naming::validate_vm_labels:64entries (MAX_VM_LABELS).validate_vm_name(1..=64ASCII characters starting with[A-Za-z0-9]and containing only[A-Za-z0-9_-]).255UTF-8 bytes (MAX_VM_LABEL_VALUE_LEN) with no ASCII or Unicode control characters.naming::non_empty_labelsso{}is stored and serialized identically toNone.openapi.jsonand threadslabelsthrough the Python, Rust, and TypeScript SDKs pluscapsem createandcapsem fork(-l / --label KEY=VALUE).Notes for Review
0.7(82604a4). feat(service,sdk): attach labels to VMs at create and expose them in list #336, feat(sdk,service): add typed ErrorCode enum, timeout/error helpers, and discovery #337 and refactor(api): share VM name validation across service and gateway #341 are service/SDK prerequisites for feat(inspect-ai): add inspect-capsem VM-mode SandboxEnvironment integration #338 (owned-session cleanup keys on these labels):feat/shared-vm-name-rule) — shared VM name validation (base0.7)feat/sdk-vm-labels) (this PR) — VM labels on create, fork, and list (base0.7)feat/sdk-typed-helpers) — structuredErrorCodeenum, timeout/lookup exceptions, and gateway discoveryfeat/inspect-capsem) — VM-modeinspect-capsemSandboxEnvironmentintegrationfeat/inspect-capsem-containers) — OCI container execution mode and Compose parserfeat/inspect-capsem-host-build) — Dockerfile / Composebuild:support; being reworked as an opt-in, evaluator-granted build for Integrate and qualify Inspect AI on current 0.7 (Pierre handoff) #342 step 40.7(2514565,+922 / -171, 61 files). The earlier draft prerequisite commits are already on0.7.Hypervisor.list(labels=...)filter (inspect-capsemfilters the returnedSandboxInfo.labelslist in the caller). If you would like server-side filtering incapsem-service, we are happy to send a small follow-up addingGET /vms/list?label=k=v(repeatable, AND semantics) across OpenAPI,capsem-service, and the generated SDKs.inspect-capsemusesmanaged-by=inspect-capsemandinspect-capsem-prefix=<slug>) — let us know if you want a reserved namespace convention.