feat(FN-3957): add delegate_task override flag to bypass executor role poli

Adds a `delegate_override` flag to the `delegate_task` tool that allows executor-role tasks to be assigned to non-executor agents. The override is persisted as metadata in the extension and honored by the heartbeat inbox guard, with test coverage across engine, core, and CLI packages plus updated do

Fusion-Task-Id: FN-3957
This commit is contained in:
Fusion
2026-05-10 19:19:15 -07:00
committed by gsxdsm
parent 878fba40ab
commit f6c32f1049
12 changed files with 160 additions and 10 deletions

View File

@@ -2007,6 +2007,14 @@ describe("fn pi extension (runnable structured-output regression slice)", () =>
expect(result.isError).not.toBe(true);
expect(result.details.agentId).toBe(reviewer.id);
const store = new TaskStore(tmpDir);
await store.init();
const task = await store.getTask(result.details.taskId);
expect(task.sourceMetadata).toMatchObject({ executorRoleOverride: true });
const selected = await store.selectNextTaskForAgent(reviewer.id, { id: reviewer.id, role: reviewer.role });
expect(selected?.task.id).toBe(task.id);
});
it("wires dependencies correctly", async () => {

View File

@@ -2747,7 +2747,10 @@ export default function kbExtension(pi: ExtensionAPI) {
dependencies: params.dependencies,
column: "todo",
assignedAgentId: params.agent_id,
source: { sourceType: "api" },
source: {
sourceType: "api",
...(params.override === true ? { sourceMetadata: { executorRoleOverride: true } } : {}),
},
});
const deps = task.dependencies.length ? ` (depends on: ${task.dependencies.join(", ")})` : "";