paperclipai/paperclip · error

The task is not available for reassignment.

Error message

The task is not available for reassignment.

What it means

TaskChatThread's reassignForRunnerGoal callback throws this fixed message when reassignment is requested but issueId is undefined. Without an issue id the issuesApi.update call cannot target a task, so the callback refuses to proceed.

Source

Thrown at ui/src/components/TaskChatThread.tsx:557

  const effectiveGoalAgentId =
    pendingComposerAssignee === null
      ? issueAssigneeAgentId
      : pendingComposerAssignee.startsWith("agent:")
        ? pendingComposerAssignee.slice("agent:".length) || null
        : null;
  const runnerGoal = useRunnerGoalControl(issueId, effectiveGoalAgentId);

  useEffect(() => {
    setPendingComposerAssignee(null);
  }, [currentAssigneeValue, issueId]);

  const reassignForRunnerGoal = useCallback(
    async (reassignment: {
      assigneeAgentId: string | null;
      assigneeUserId: string | null;
    }) => {
      if (!issueId)
        throw new Error("The task is not available for reassignment.");
      await issuesApi.update(issueId, { ...reassignment, deferWakeForGoal: true });
      await queryClient.invalidateQueries({
        queryKey: queryKeys.issues.detail(issueId),
      });
    },
    [issueId, queryClient],
  );

  const queuedMessageQueue =
    queuedCommentQueue && queuedCommentQueue.entries.length > 0
      ? queuedCommentQueue
      : null;
  const queuedCommentIds = useMemo(
    () =>
      new Set(
        queuedMessageQueue?.entries.map((entry) => entry.comment.id) ?? [],
      ),
    [queuedMessageQueue],

View on GitHub (pinned to 01ad858492)

Solutions

  1. Ensure TaskChatThread is only mounted with a valid issueId
  2. Disable reassign controls until the issue detail query resolves
  3. Guard the caller: check issueId before invoking reassignment

Example fix

// before
if (!issueId) throw new Error("The task is not available for reassignment.");
// after
if (!issueId) {
  toastActions?.pushToast({ title: "Save the task before reassigning", tone: "warning" });
  return;
}
Defensive patterns

Strategy: validation

Validate before calling

if (!issueId) { showToast('No task loaded'); return; }

Type guard

function hasIssueId(p: { issueId?: string | null }): p is { issueId: string } { return typeof p.issueId === 'string' && p.issueId.length > 0; }

Try / catch

try { await reassignForRunnerGoal({ assigneeAgentId, assigneeUserId }); } catch (e) { if (/not available for reassignment/.test(e.message)) showToast('Open a saved task first'); else throw e; }

Prevention

When it happens

Trigger: The reassignment UI (runner-goal flow) invokes onReassign while the thread is rendered outside a loaded issue context — issueId prop is null/undefined (draft thread, detached view, or issue failed to load).

Common situations: Rendering TaskChatThread in a preview/draft state where no issue is persisted yet, issue deleted before reassignment completes, race where the panel renders before issueId is resolved.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-10). Data as JSON: /api/errors/e7f7d8eb65b54311. Report an issue: GitHub.