paperclipai/paperclip · error

The queued message no longer has an active run target.

Error message

The queued message no longer has an active run target.

What it means

steerQueuedComment revises a queued (not-yet-sent) comment and needs both a queue id and the target run id it is anchored to. If either is missing — the queued comment's queue was dissolved, its target run finished, or the data is not loaded — it throws this error rather than posting a steer to a nonexistent target. It prevents steering into a void.

Source

Thrown at ui/src/pages/IssueDetail.tsx:2070

        );
      } catch (error) {
        await refreshQueueAfterConflict(error);
      }
    },
    [
      effectiveQueuedCommentQueue?.queueId,
      issueId,
      refreshQueueAfterConflict,
      storeQueuedCommentQueue,
    ],
  );

  const steerQueuedComment = useCallback(
    async (commentId: string, revision: string) => {
      const queueId = effectiveQueuedCommentQueue?.queueId;
      const targetRunId = effectiveQueuedCommentQueue?.targetRunId;
      if (!queueId || !targetRunId)
        throw new Error(
          "The queued message no longer has an active run target.",
        );
      const anchorAt = new Date().toISOString();
      setLocalSteeringPlacements((current) => {
        const next = new Map(current);
        const sequence = [...current.values()].filter(
          (placement) => placement.targetRunId === targetRunId,
        ).length;
        next.set(commentId, { targetRunId, anchorAt, sequence });
        return next;
      });
      setConsumedQueuedCommentIds((current) => new Set(current).add(commentId));
      try {
        const nextQueue = await issuesApi.steerQueuedComment(
          issueId,
          commentId,
          {
            queueId,

View on GitHub (pinned to 01ad858492)

Solutions

  1. Refresh the issue/comment queue state; if the run finished, the message can no longer be steered — send it as a new comment instead.
  2. Disable the edit control for queued comments whose queue/targetRunId is no longer present.
  3. Re-check effectiveQueuedCommentQueue on submit and fall back to posting a fresh comment when the queue is gone.
  4. If this reproduces while a run is active, inspect why the queue's targetRunId is unset (backend queue registration).

Example fix

// before
if (!queueId || !targetRunId)
  throw new Error("The queued message no longer has an active run target.");
// after
if (!queueId || !targetRunId) {
  toast.info("The run ended — sending as a new message instead.");
  await postComment(issueId, revision);
  return;
}
Defensive patterns

Strategy: validation

Validate before calling

const canSteer = Boolean(effectiveQueuedCommentQueue?.queueId && effectiveQueuedCommentQueue?.targetRunId);
if (!canSteer) {
  toast.info("The queued message can no longer be edited — the run has ended.");
  return;
}

Type guard

const hasSteerTarget = (q: { queueId?: string; targetRunId?: string } | null | undefined):
  q is { queueId: string; targetRunId: string } =>
  typeof q?.queueId === "string" && typeof q?.targetRunId === "string";

Try / catch

try {
  await steerQueuedComment(commentId, revision);
} catch (e) {
  if (e.message.includes("no longer has an active run target")) {
    await postComment(issueId, revision);
  } else throw e;
}

Prevention

When it happens

Trigger: Calling steerQueuedComment(commentId, revision) when effectiveQueuedCommentQueue is null/undefined or lacks queueId/targetRunId — e.g. the target run completed and the queue reference cleared between rendering the edit UI and submitting the revision.

Common situations: User edits a queued message while the run it targeted finishes and the queue is torn down; the queue data query is still loading; a stale UI kept the edit affordance after the queue was consumed.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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