feat: add two-level work mode (projectExecution + roleExecution) (#15) (#18)

Replaces single 'workMode' with two distinct settings:

1. Plugin-level 'projectExecution' (parallel | sequential)
   - parallel: each project can have active workers independently
   - sequential: only one project can have active workers at a time

2. Project-level 'roleExecution' (parallel | sequential)
   - parallel: DEV and QA can run simultaneously on same project
   - sequential: only one role (DEV or QA) active at a time per project

Changes:
- index.ts: rename workMode → projectExecution in config schema
- projects.ts: add roleExecution field to Project type
- heartbeat_tick: check both levels before picking up tasks
- task_pickup: enforce roleExecution when picking up manually
- project_register: accept roleExecution param (default: parallel)
- devclaw_setup: accept projectExecution param

All defaults remain 'parallel' for backward compatibility.
This commit is contained in:
Lauren ten Hoor
2026-02-10 00:50:52 +08:00
committed by GitHub
parent d40aa41b16
commit aae6c2ee78
7 changed files with 92 additions and 34 deletions

View File

@@ -106,6 +106,11 @@ export function createProjectRegisterTool(api: OpenClawPluginApi) {
type: "string",
description: "Deployment URL for the project",
},
roleExecution: {
type: "string",
enum: ["parallel", "sequential"],
description: "Project-level role execution mode: parallel (DEV and QA can work simultaneously) or sequential (only one role active at a time). Defaults to parallel.",
},
},
},
@@ -117,6 +122,7 @@ export function createProjectRegisterTool(api: OpenClawPluginApi) {
const baseBranch = params.baseBranch as string;
const deployBranch = (params.deployBranch as string) ?? baseBranch;
const deployUrl = (params.deployUrl as string) ?? "";
const roleExecution = (params.roleExecution as "parallel" | "sequential") ?? "parallel";
const workspaceDir = ctx.workspaceDir;
if (!workspaceDir) {
@@ -199,6 +205,7 @@ export function createProjectRegisterTool(api: OpenClawPluginApi) {
baseBranch,
deployBranch,
autoChain: false,
roleExecution,
dev: emptyWorkerState([...DEV_TIERS]),
qa: emptyWorkerState([...QA_TIERS]),
};