{"record":{"id":"735618bd8516fe6b","repo":"paperclipai/paperclip","slug":"the-queued-message-no-longer-has-an-active-run-tar","errorCode":null,"errorMessage":"The queued message no longer has an active run target.","messagePattern":"The queued message no longer has an active run target\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ui/src/pages/IssueDetail.tsx","lineNumber":2132,"sourceCode":"        );\n      } catch (error) {\n        await refreshQueueAfterConflict(error);\n      }\n    },\n    [\n      effectiveQueuedCommentQueue?.queueId,\n      issueId,\n      refreshQueueAfterConflict,\n      storeQueuedCommentQueue,\n    ],\n  );\n\n  const steerQueuedComment = useCallback(\n    async (commentId: string, revision: string) => {\n      const queueId = effectiveQueuedCommentQueue?.queueId;\n      const targetRunId = effectiveQueuedCommentQueue?.targetRunId;\n      if (!queueId || !targetRunId)\n        throw new Error(\n          \"The queued message no longer has an active run target.\",\n        );\n      try {\n        const nextQueue = await issuesApi.steerQueuedComment(\n          issueId,\n          commentId,\n          {\n            queueId,\n            targetRunId,\n            revision,\n          },\n        );\n        // Keep the queue component mounted until the server accepts steering:\n        // its pending/error state must survive a rejected last-row action.\n        const anchorAt = new Date().toISOString();\n        setLocalSteeringPlacements((current) => {\n          const next = new Map(current);\n          const sequence = [...current.values()].filter(","sourceCodeStart":2114,"sourceCodeEnd":2150,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/ui/src/pages/IssueDetail.tsx#L2114-L2150","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Refresh the issue/comment queue state; if the run finished, the message can no longer be steered — send it as a new comment instead.","Disable the edit control for queued comments whose queue/targetRunId is no longer present.","Re-check effectiveQueuedCommentQueue on submit and fall back to posting a fresh comment when the queue is gone.","If this reproduces while a run is active, inspect why the queue's targetRunId is unset (backend queue registration)."],"exampleFix":"// before\nif (!queueId || !targetRunId)\n  throw new Error(\"The queued message no longer has an active run target.\");\n// after\nif (!queueId || !targetRunId) {\n  toast.info(\"The run ended — sending as a new message instead.\");\n  await postComment(issueId, revision);\n  return;\n}","handlingStrategy":"validation","validationCode":"const canSteer = Boolean(effectiveQueuedCommentQueue?.queueId && effectiveQueuedCommentQueue?.targetRunId);\nif (!canSteer) {\n  toast.info(\"The queued message can no longer be edited — the run has ended.\");\n  return;\n}","typeGuard":"const hasSteerTarget = (q: { queueId?: string; targetRunId?: string } | null | undefined):\n  q is { queueId: string; targetRunId: string } =>\n  typeof q?.queueId === \"string\" && typeof q?.targetRunId === \"string\";","tryCatchPattern":"try {\n  await steerQueuedComment(commentId, revision);\n} catch (e) {\n  if (e.message.includes(\"no longer has an active run target\")) {\n    await postComment(issueId, revision);\n  } else throw e;\n}","preventionTips":["Disable queued-message editing once the target run is no longer active.","Re-validate the queue reference at submit time, not just at render time.","Fall back to posting a new comment when the queue dissolves mid-edit."],"tags":["ui","stale-data","queue","steering"],"backgroundTag":"resource-not-found","analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}