Project-scoped AI task pause with confirmation that admitted workspace launches have drained #3211
skudr opened 15 hours ago

Question / enhancement request

Is there a supported way to pause AI task admission for one project and then confirm that all previously admitted workspace-launch handlers have finished?

We need a safe point for an operator to clean up the project's AI workspaces and resume automation explicitly, without stopping the whole OneDev server or disabling the same AI users in other projects.

Why revoking permission and listing workspaces may not be enough

We use OneDev 16.9.7. Reading that tag suggests a possible interval between permission checking and workspace creation:

  • DefaultListenerRegistry.post dispatches project-event listeners asynchronously after commit (DefaultListenerRegistry.java:109–129).
  • The issue notification path checks canCreateWorkspace before preparing and running the prompt (IssueNotificationManager.java:287–288,451–475,500–508).
  • DefaultWorkspaceService.runPrompt selects an applicable automation spec and creates a workspace without repeating that permission check (DefaultWorkspaceService.java:1157–1175).

Therefore, an event handler that already passed the permission check might still create a workspace after an operator revokes the AI user's project authorization. A single empty workspace listing would not establish that all previously admitted launches have completed.

This is an inference from source ordering, not a reproduced race or a claim that permission revocation is documented as a drain operation. We may be missing an existing supported mechanism.

Desired contract

A documented procedure or project-scoped operation that lets an operator:

  1. Prevent new AI task admissions for the selected project.
  2. Obtain a completion acknowledgement once previously admitted handlers can no longer create additional workspaces, or have been cancelled before creation.
  3. Clean up existing AI workspaces separately and resume admission explicitly.

It should not require disabling those AI users globally or pausing unrelated projects. An admission/drain acknowledgement is distinct from an empty list of currently visible workspaces.

Does such a mechanism already exist in 16.9.7 or a later release? If not, could a supported project-level pause/drain contract be added?

1/1
Type
Enhancement
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (2)
Reference
OD-3211
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover