fix: disable auto-tick in work_start to prevent unwanted worker dispatch

Problem:
The work_start tool was automatically running a 'tick' after picking up
an issue, which filled parallel worker slots by dispatching additional
workers for other issues without explicit instruction.

Example: Picking up #123 also auto-dispatched QA for #121 via tickPickups.

Root Cause:
work_start called tickAndNotify() which ran projectTick() to fill free
worker slots in parallel execution mode. This behavior was automatic and
not controllable.

Solution:
- Disabled the auto-tick functionality in work_start
- Commented out the tickAndNotify call
- Removed tickPickups from the response
- Updated documentation to reflect the change

Impact:
- work_start now picks up ONLY the explicitly requested issue
- No automatic worker dispatch for parallel slots
- For filling worker slots, use work_heartbeat instead
- Gives more control over worker assignments

Changes:
- lib/tools/work-start.ts:
  * Commented out tickAndNotify call
  * Removed tickPickups from output
  * Updated file header comment
  * Updated tool description

Addresses issue #125
This commit is contained in:
Lauren ten Hoor
2026-02-11 03:14:40 +08:00
parent 5df4b912c9
commit 28bc3cddd2

View File

@@ -3,7 +3,7 @@
* *
* Context-aware: ONLY works in project group chats. * Context-aware: ONLY works in project group chats.
* Auto-detects: projectGroupId, role, level, issueId. * Auto-detects: projectGroupId, role, level, issueId.
* After dispatch, ticks the project queue to fill parallel slots. * Picks up only the explicitly requested issue (auto-tick disabled).
*/ */
import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
import { jsonResult } from "openclaw/plugin-sdk"; import { jsonResult } from "openclaw/plugin-sdk";
@@ -21,7 +21,7 @@ export function createWorkStartTool(api: OpenClawPluginApi) {
return (ctx: ToolContext) => ({ return (ctx: ToolContext) => ({
name: "work_start", name: "work_start",
label: "Work Start", label: "Work Start",
description: `Pick up a task from the issue queue. ONLY works in project group chats. Handles label transition, level assignment, session creation, dispatch, audit, and ticks the queue to fill parallel slots.`, description: `Pick up a task from the issue queue. ONLY works in project group chats. Handles label transition, level assignment, session creation, dispatch, and audit. Picks up only the explicitly requested issue.`,
parameters: { parameters: {
type: "object", type: "object",
properties: { properties: {
@@ -110,12 +110,9 @@ export function createWorkStartTool(api: OpenClawPluginApi) {
{ workspaceDir, config: notifyConfig, groupId, channel: context.channel }, { workspaceDir, config: notifyConfig, groupId, channel: context.channel },
); );
// Tick: fill parallel slots + notify starts // Auto-tick disabled per issue #125 - work_start should only pick up the explicitly requested issue
const tickPickups = await tickAndNotify({ // To fill parallel slots, use work_heartbeat instead
workspaceDir, groupId, agentId: ctx.agentId, pluginConfig, sessionKey: ctx.sessionKey, // const tickPickups = await tickAndNotify({ ... });
targetRole: role === "dev" ? "qa" : "dev",
channel: context.channel,
});
const output: Record<string, unknown> = { const output: Record<string, unknown> = {
success: true, project: project.name, groupId, issueId: issue.iid, issueTitle: issue.title, success: true, project: project.name, groupId, issueId: issue.iid, issueTitle: issue.title,
@@ -124,7 +121,7 @@ export function createWorkStartTool(api: OpenClawPluginApi) {
levelReason, levelSource, levelReason, levelSource,
autoDetected: { projectGroupId: !groupIdParam, role: !roleParam, issueId: issueIdParam === undefined, level: !levelParam }, autoDetected: { projectGroupId: !groupIdParam, role: !roleParam, issueId: issueIdParam === undefined, level: !levelParam },
}; };
if (tickPickups.length) output.tickPickups = tickPickups; // tickPickups removed with auto-tick
return jsonResult(output); return jsonResult(output);
}, },