{"record":{"id":"0e75f7663e9e68ee","repo":"paperclipai/paperclip","slug":"runner-goal-stop-unconfirmed","errorCode":"runner_goal_stop_unconfirmed","errorMessage":"runner_goal_stop_unconfirmed: The provider did not confirm that the live agent goal stopped.","messagePattern":"runner_goal_stop_unconfirmed: The provider did not confirm that the live agent goal stopped\\.","errorType":"error_code","errorClass":"RunnerGoalActionError","httpStatus":null,"severity":"error","filePath":"server/src/services/runner-goals.ts","lineNumber":997,"sourceCode":"        commandId: `goal_${requestId}`,\n      });\n  const completion = adapterControl?.completion ?? nativeControl?.completion ?? null;\n  if (!completion) {\n    throw new RunnerGoalActionError(\n      \"runner_goal_live_controller_unavailable\",\n      \"The live agent goal controller is unavailable; the run was not interrupted.\",\n    );\n  }\n  await completion;\n\n  const deadline = Date.now() + 5_000;\n  while (Date.now() < deadline) {\n    const observed = await goals.projection(binding.companyId, binding.issueId, binding.agentId);\n    if (action === \"pause\" && observed?.goal?.status === \"paused\") return \"paused\";\n    if (action === \"clear\" && observed?.goal === null) return \"cleared\";\n    await new Promise<void>((resolve) => setTimeout(resolve, 25));\n  }\n  throw new RunnerGoalActionError(\n    \"runner_goal_stop_unconfirmed\",\n    \"The provider did not confirm that the live agent goal stopped.\",\n  );\n}\n","sourceCodeStart":979,"sourceCodeEnd":1002,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/runner-goals.ts#L979-L1002","documentation":"settleLiveRunnerGoalBeforeInterrupt polls the goal projection every 25ms for up to 5 seconds after issuing a pause or clear to the live provider. If the projection never shows status \"paused\" (for pause) or a null goal (for clear) within that window, it throws RunnerGoalActionError(runner_goal_stop_unconfirmed): the command was delivered but the provider never confirmed the stop, so the caller must not interrupt the process.","triggerScenarios":"Calling settleLiveRunnerGoalBeforeInterrupt() where the adapter/PRP completion resolves but goals.projection() still returns an active goal after 5s: the provider accepted the pause/clear command yet never applied it, or applied it slower than the 5s deadline, or the projection read path diverges from the applied state.","commonSituations":"Slow or overloaded provider taking longer than 5 seconds to honor pause/clear; a provider that acks control commands without acting on them; projection staleness (event not yet applied via applyRunnerGoalPrpEvent); long-running non-interruptible work in the agent that defers the pause.","solutions":["Retry settleLiveRunnerGoalBeforeInterrupt after a short wait — the provider may simply have been slower than the 5s deadline; check the projection first, as the goal may now be paused/cleared.","Inspect the provider/adapter logs to see whether the pause/clear command was actually processed; fix the provider handler if it acks without applying.","Verify the goal event path (applyRunnerGoalPrpEvent / projection) is applying state changes for this session; a stuck projection makes confirmation impossible.","If the goal is genuinely stuck active, stop it through the provider's own UI/CLI, then re-run the interrupt flow once the projection shows paused or cleared."],"exampleFix":"// before\ntry { await settleLiveRunnerGoalBeforeInterrupt(db, binding); } catch (e) { interruptProcess(); }\n// after\ntry {\n  await settleLiveRunnerGoalBeforeInterrupt(db, binding);\n} catch (e) {\n  if (e?.code === \"runner_goal_stop_unconfirmed\") {\n    const p = await runnerGoalService(db).projection(binding.companyId, binding.issueId, binding.agentId);\n    if (p?.goal?.status === \"paused\" || p?.goal === null) return; // late confirmation; now safe\n  }\n  throw e; // still unconfirmed — do NOT interrupt\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["timeout","control-plane","provider"],"backgroundTag":"request-timeout","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"}