ruvnet/ruflo · error · Error
Failed to create share link
Error message
Failed to create share link
What it means
task_assign (simple implementation path) looks the task up in the in-memory taskStore and throws 'Task not found: <id>' when the Map has no entry. This runs after an orchestrator attempt failed ('Failed to assign task via orchestrator:' on console). Note the ordering of guards: an already-assigned task only soft-returns assigned:false when reassign is not set; a missing task throws before any of those checks.
Solutions
- Ensure task_create and task_assign run against the same MCP server process; re-create the task after any restart and use the new ID
- List tasks before assigning to confirm the ID is live
- Fix the orchestrator if console logs show the assign attempt failing there — the local fallback only knows local tasks
- Keep a durable taskId registry in your orchestration layer so restarts trigger re-creation instead of dead-ID assignments
Example fix
// before
await client.callTool('task_assign', { taskId: oldTaskId, agentId: 'worker-1' }); // throws [1135]
// after
const { task } = await client.callTool('task_create', { type: 'implementation', description: '...' });
await client.callTool('task_assign', { taskId: task.id, agentId: 'worker-1' }); Defensive patterns
Strategy: validation
Validate before calling
const { tasks } = await client.callTool('task_list', {});
const assignable = tasks.find(t => t.id === taskId && !['completed', 'cancelled', 'failed'].includes(t.status));
if (!assignable) throw new Error(`no assignable task ${taskId}`); Try / catch
try {
await client.callTool('task_assign', { taskId, agentId });
} catch (e) {
if (e instanceof Error && e.message.startsWith('Task not found')) {
const { task } = await client.callTool('task_create', { type: 'implementation', description: `recreated ${taskId}` });
return client.callTool('task_assign', { taskId: task.id, agentId });
}
throw e;
} Prevention
- Create and assign tasks within the same server session
- Keep your own agent->task dispatch map keyed by fresh IDs
- Surface orchestrator health separately so the fallback store is a known, deliberate state
When it happens
Trigger: task_assign for an ID created in a previous process; orchestrator down or throwing so the code falls through to an empty local store; assigning to a task ID that was pruned or never created; passing an agent spawn name as taskId by mistake.
Common situations: Restarting the MCP server between creating tasks and dispatching them to agents; multi-instance deployments where task creation and assignment hit different server processes; scripts reusing IDs from a prior campaign.
Related errors
- JSON.stringify(response.error)
- SSRF guard: private/loopback host rejected
- Task not found
- User not found
- User token not found
AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18).
Data as JSON: /api/errors/8fb8055856bc31c7.
Report an issue: GitHub.
Appendix: source
Thrown at ruflo/src/ruvocal/src/lib/createShareLink.ts:22
// Returns a public share URL for a conversation id.
// If `id` is already a 7-char share id, no network call is made.
export async function createShareLink(id: string): Promise<string> {
const prefix =
page.data.publicConfig.PUBLIC_SHARE_PREFIX ||
`${page.data.publicConfig.PUBLIC_ORIGIN || page.url.origin}${base}`;
if (id.length === 7) {
return `${prefix}/r/${id}`;
}
const res = await fetch(`${base}/conversation/${id}/share`, {
method: "POST",
headers: { "Content-Type": "application/json" },
});
if (!res.ok) {
const text = await res.text().catch(() => "");
throw new Error(text || "Failed to create share link");
}
const { shareId } = await res.json();
return `${prefix}/r/${shareId}`;
}
View on GitHub (pinned to fa13ee4ad6)