feat(automations): allow project-less session automations
Merged
KI
3mo ago+6938+6938+0123456789012345678901234567890123456789-98-98-01234567890123456789
Summary
Stacked on #6274 (sessions). Automations can now run without a project, completing the "no project = session" convention across every creation surface (desktop, CLI, MCP, SDK — and now scheduled runs).
Session automation = no project and no workspace pin. Each run creates a project-less session workspace on the target host via workspaces.createSession (managed folder under ~/.superset/sessions), then launches the agent exactly as before — agents.run was already project-agnostic. Pinning an existing session workspace also works now.
Changes
Cloud
automations.v2_project_id→ nullable (migration0064, singleDROP NOT NULL; the FK was already dropped in 0062)automation.create: the denormalized pin path requires onlyv2WorkspaceId + targetHostId— a null project means a session pin; the "v2ProjectId required" throw is gone (omit both = session mode)automation.update: explicitv2ProjectId: nullswitches to session mode (and clears any pin);undefinedkeeps the projectdispatch.ts: null project relaysworkspaces.createSession(host dedupes the folder name per run) instead ofworkspaces.create; no branch computation. Stale-pin recovery falls back to the same path.
Desktop
- Automation ProjectPicker: "No project (session)" option
- WorkspacePicker: with no project selected it lists the host's session workspaces; "New workspace" copy becomes "New session"
- Create dialog: tri-state selection (unchosen → auto-default first project; explicit "No project" respected); prompt file-search degrades gracefully (no project to search)
- List rows + sort show "Session" instead of "—"
CLI / MCP / SDK
automations create:--projectoptional — omit both--projectand--workspacefor session mode; session workspaces accepted as--workspacetargets (previous hard rejection removed)automations update: new--sessionflag (clears project + pin)- MCP tool schemas + SDK types widened with session-mode docs
Notes
- Old pre-denormalization clients pinning cloud workspaces still resolve via the legacy
verifyWorkspaceInOrgbranch, unchanged. - Deploy ordering: cloud/API must deploy before this desktop build goes out (standard).
Testing
- Full repo typecheck + lint green
- Host-side
createSessionbehavior covered by #6274's integration tests - Follow-up: E2E dispatch verification (run-now on a session automation) once #6274 merges
Summary by cubic
Enable session automations: automations can now run with no project and no workspace pin. Each run creates a project-less session workspace on the target host.
-
New Features
- Cloud/API:
automations.v2_project_idis nullable (migration0064);automation.create/updateacceptv2ProjectId: null; denormalized pins no longer require a project. - Dispatch: when
v2ProjectIdis null, runs callworkspaces.createSession; session workspaces can be pinned. - Desktop: ProjectPicker adds “No project (session)”; WorkspacePicker lists session workspaces and shows “New session”; create dialog supports tri-state; automation lists show “Session”.
- CLI:
automations createmakes--projectoptional (omit with no--workspacefor session mode);automations updateadds--session; session workspaces are valid--workspacetargets. - MCP/SDK: schemas/types allow nullable
v2ProjectId; docs clarify session pins requiretargetHostIdand unpinning to session mode sendsv2WorkspaceId: null.
- Cloud/API:
-
Bug Fixes
- Update flow skips legacy cloud-table resolution for retained pins to avoid “Workspace not found” on session-pinned automations.
- CLI: validate
--sessionconflicts before togglingenabled, preventing partial updates. - Desktop: WorkspacePicker shows neutral copy while no project is chosen (pre-default), not session mode.