Repository navigation
workspace: align v1alpha1 schema, enforce immutability, and materialize spec.setup - #580
Conversation
…ze spec.setup - pkg/apis/v1alpha1: add shared Profile, drop ResourcesSpec.requests, group build-time steps under WorkspaceSpec.setup (git with ref, files, skills, commands, gateway), add spec.profile and WorkspaceStatus, replace UpdateWorkspace with CreateWorkspace, and add pagination to ListWorkspaces. - internal/apivalidation: validate Workspace profile, setup (git, files, skills, commands), and gateway references. - internal/store & internal/server: add pagination to ListWorkspaces, enforce idempotent/immutable CreateWorkspace, and reject unserved gateway bindings with codes.Unimplemented. - internal/workspace: split git helpers into git.go and materialize spec.setup (git branch/tag/SHA checkout, inline files, skills dir, and sequential setup commands). - cmd/ax, test/e2e, docs: extract cmd/ax/workspace.go and update CLI, manifests, and E2E tests for CreateWorkspace and spec.setup.
yongruilin
left a comment
There was a problem hiding this comment.
Thanks for the PR! Looks good in general, left some comments.
mayawang
left a comment
There was a problem hiding this comment.
Nice, this lines up well with the warm workspace plan. Two non-blocking notes: this breaks existing Workspace manifests (git/files move under setup), so worth a migration line in the next release notes. And setup commands have no timeout, so a hanging one leaves the workspace never ready, maybe a per-command timeout in a follow-up?
- pkg/apis/v1alpha1: drop MCPServer.gateway (egress and credential injection are configured on the Task's Gateway). - internal/server: also reject spec.profile with codes.Unimplemented until snapshot pre-warming is wired, and simplify the TODO comment. - internal/workspace: apply a 5m per-command timeout to spec.setup.commands (killing the command's process group on timeout) so hung commands cannot leave a workspace unready indefinitely. - runner: return SetupWorkspace errors directly from Run instead of starting spec.command in a failed workspace.
sure, I added the timeout for setup command. |
Aligns the
v1alpha1WorkspaceAPI schema for snapshot-based workspace setup, makesWorkspaceimmutable, and materializesspec.setupinside the sandbox.pkg/apis/v1alpha1): Add sharedProfile(common.proto), dropResourcesSpec.requests, move build-time steps underWorkspaceSpec.setup(gitwithref,files,skills,commands,gateway), addspec.profileandWorkspaceStatus, replaceUpdateWorkspacewithCreateWorkspace, and addlimit/offsetpagination toListWorkspaces.internal/apivalidation,internal/server,internal/store): ValidateProfile,spec.setup, and gateway references; makeCreateWorkspaceidempotent on identical specs and reject mutations withFailedPrecondition; reject unserved gateway bindings withUnimplemented.internal/workspace): Split git operations intogit.goand executespec.setupin order (gitbranch/tag/SHA checkout ->files->skills->commands).cmd/ax,docs/manifests.md,test/e2e): Extractcmd/ax/workspace.goand update CLI commands, docs, examples, and E2E tests for the new schema.There are some todo that will be handled in following pr after integration with task and gateway. The pr does not do warm snapshot or setup actor yet.
issue: #563