Revert "fix: add explicit worker state update in task_pickup after dispatch (#23)"

This reverts commit d727a812e6.
This commit is contained in:
Lauren ten Hoor
2026-02-10 08:58:01 +08:00
parent d727a812e6
commit 31481d4ae2

View File

@@ -17,7 +17,7 @@ import { dispatchTask } from "../dispatch.js";
import { type Issue, type StateLabel } from "../task-managers/task-manager.js";
import { createProvider } from "../task-managers/index.js";
import { selectModel } from "../model-selector.js";
import { activateWorker, getProject, getWorker, readProjects } from "../projects.js";
import { getProject, getWorker, readProjects } from "../projects.js";
import type { ToolContext } from "../types.js";
import { detectContext, generateGuardrails } from "../context-guard.js";
import { isDevTier, isTier, type Tier } from "../tiers.js";
@@ -313,27 +313,6 @@ export function createTaskPickupTool(api: OpenClawPluginApi) {
pluginConfig,
});
// 8b. Explicitly update worker state in projects.json
// Defense in depth: ensure state is set even if dispatchTask had issues
const now = new Date().toISOString();
const stateUpdateParams: {
issueId: string;
model: string;
sessionKey?: string;
startTime?: string;
} = {
issueId: String(issue.iid),
model: modelAlias,
};
// Only set sessionKey and startTime on new spawn (not on reuse)
if (dispatchResult.sessionAction === "spawn") {
stateUpdateParams.sessionKey = dispatchResult.sessionKey;
stateUpdateParams.startTime = now;
}
await activateWorker(workspaceDir, groupId, role, stateUpdateParams);
// 9. Send notification to project group
const notifyConfig = getNotificationConfig(pluginConfig);
await notify(