-
Notifications
You must be signed in to change notification settings - Fork 948
Open
Open
Copy link
Labels
Description
Description
Prebuilt workspaces are currently initialized with some lifecycle-related parameters intended for regular workspaces, such as deadline
, next_start_at
, last_used_at
, etc. This causes confusion and inconsistencies across the system.
Problems
- Incorrect initialization: Prebuilt workspaces should not have scheduling-related parameters (like
deadline
ornext_start_at
) set at creation time, since they are not subject to lifecycle scheduling logic (autostart, autostop, dormancy, etc.). - Frontend UX issues: The presence of values like
deadline
in a prebuild leads the UI to incorrectly display workspace scheduling information (e.g., a clock showing the workspace will stop when in fact prebuilds are not subject to stop). Should we use the prebuild TTL here? - Dormancy logic edge case: When a prebuild is claimed,
last_used_at
is not updated, potentially causing a race condition where the lifecycle executor marks the workspace as dormant before the user has a chance to use it.
Expected behavior
- On initialization: Prebuilt workspaces should not be assigned workspace lifecycle fields (e.g.,
deadline
,next_start_at
). - On claim: Once claimed, these parameters should be correctly populated as part of converting the prebuild into a regular workspace, to allow proper handling by lifecycle logic.
Follow-up from: #18740