feat(FN-3593): add test isolation CI enforcement, fix stuck-requeue race, a
This merge lands five FN-3593 commits establishing a test isolation contract with a new `scripts/check-test-isolation.mjs` guard that scans for accidental `beforeEach`/`afterEach`/`beforeAll`/`afterAll` in setup helpers, plus per-package `setup-test-isolation.ts` bootstraps that canonicalize the pat Fusion-Task-Id: FN-3593
This commit is contained in:
@@ -3163,11 +3163,36 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
||||
} else if (updates.blockedBy !== undefined) {
|
||||
task.blockedBy = updates.blockedBy;
|
||||
}
|
||||
const previousAssignedAgentId = task.assignedAgentId;
|
||||
if (updates.assignedAgentId === null) {
|
||||
task.assignedAgentId = undefined;
|
||||
} else if (updates.assignedAgentId !== undefined) {
|
||||
task.assignedAgentId = updates.assignedAgentId;
|
||||
}
|
||||
// If the agent that paused this task is being unassigned (or replaced),
|
||||
// auto-unpause: the pause was tied to that agent's lifecycle, and now
|
||||
// there's no longer a relationship that justifies keeping the task paused.
|
||||
const assignmentChanged =
|
||||
updates.assignedAgentId !== undefined && task.assignedAgentId !== previousAssignedAgentId;
|
||||
if (
|
||||
assignmentChanged &&
|
||||
task.paused &&
|
||||
task.pausedByAgentId &&
|
||||
task.pausedByAgentId === previousAssignedAgentId
|
||||
) {
|
||||
task.paused = undefined;
|
||||
task.pausedByAgentId = undefined;
|
||||
if (task.column === "in-progress" || task.column === "in-review") {
|
||||
if (task.status === "paused") {
|
||||
task.status = undefined;
|
||||
}
|
||||
}
|
||||
task.log.push({
|
||||
timestamp: new Date().toISOString(),
|
||||
action: `Task unpaused (agent ${previousAssignedAgentId} unassigned)`,
|
||||
...(runContext ? { runContext } : {}),
|
||||
});
|
||||
}
|
||||
if (updates.pausedByAgentId === null) {
|
||||
task.pausedByAgentId = undefined;
|
||||
} else if (updates.pausedByAgentId !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user