{"record":{"id":"8fb8055856bc31c7","repo":"ruvnet/ruflo","slug":"failed-to-create-share-link","errorCode":null,"errorMessage":"Failed to create share link","messagePattern":"Failed to create share link","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ruflo/src/ruvocal/src/lib/createShareLink.ts","lineNumber":22,"sourceCode":"// Returns a public share URL for a conversation id.\n// If `id` is already a 7-char share id, no network call is made.\nexport async function createShareLink(id: string): Promise<string> {\n\tconst prefix =\n\t\tpage.data.publicConfig.PUBLIC_SHARE_PREFIX ||\n\t\t`${page.data.publicConfig.PUBLIC_ORIGIN || page.url.origin}${base}`;\n\n\tif (id.length === 7) {\n\t\treturn `${prefix}/r/${id}`;\n\t}\n\n\tconst res = await fetch(`${base}/conversation/${id}/share`, {\n\t\tmethod: \"POST\",\n\t\theaders: { \"Content-Type\": \"application/json\" },\n\t});\n\n\tif (!res.ok) {\n\t\tconst text = await res.text().catch(() => \"\");\n\t\tthrow new Error(text || \"Failed to create share link\");\n\t}\n\n\tconst { shareId } = await res.json();\n\treturn `${prefix}/r/${shareId}`;\n}\n","sourceCodeStart":4,"sourceCodeEnd":28,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/ruflo/src/ruvocal/src/lib/createShareLink.ts#L4-L28","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nawait client.callTool('task_assign', { taskId: oldTaskId, agentId: 'worker-1' }); // throws [1135]\n\n// after\nconst { task } = await client.callTool('task_create', { type: 'implementation', description: '...' });\nawait client.callTool('task_assign', { taskId: task.id, agentId: 'worker-1' });","handlingStrategy":"validation","validationCode":"const { tasks } = await client.callTool('task_list', {});\nconst assignable = tasks.find(t => t.id === taskId && !['completed', 'cancelled', 'failed'].includes(t.status));\nif (!assignable) throw new Error(`no assignable task ${taskId}`);","typeGuard":null,"tryCatchPattern":"try {\n  await client.callTool('task_assign', { taskId, agentId });\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Task not found')) {\n    const { task } = await client.callTool('task_create', { type: 'implementation', description: `recreated ${taskId}` });\n    return client.callTool('task_assign', { taskId: task.id, agentId });\n  }\n  throw e;\n}","preventionTips":["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"],"tags":["mcp","task","not-found","assignment","orchestrator"],"backgroundTag":"task-not-found","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}