{"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":null,"httpStatus":null,"severity":"error","filePath":"ui/src/pages/IssueDetail.tsx","lineNumber":2070,"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      const anchorAt = new Date().toISOString();\n      setLocalSteeringPlacements((current) => {\n        const next = new Map(current);\n        const sequence = [...current.values()].filter(\n          (placement) => placement.targetRunId === targetRunId,\n        ).length;\n        next.set(commentId, { targetRunId, anchorAt, sequence });\n        return next;\n      });\n      setConsumedQueuedCommentIds((current) => new Set(current).add(commentId));\n      try {\n        const nextQueue = await issuesApi.steerQueuedComment(\n          issueId,\n          commentId,\n          {\n            queueId,","sourceCodeStart":2052,"sourceCodeEnd":2088,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/ui/src/pages/IssueDetail.tsx#L2052-L2088","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":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}