{"record":{"id":"bd77df45484b2870","repo":"paperclipai/paperclip","slug":"session-goals-unsupported","errorCode":"session_goals_unsupported","errorMessage":"session_goals_unsupported: Session goals are unsupported.","messagePattern":"session_goals_unsupported: Session goals are unsupported\\.","errorType":"error_code","errorClass":"RunnerGoalActionError","httpStatus":null,"severity":"warning","filePath":"server/src/services/runner-goals.ts","lineNumber":366,"sourceCode":"    };\n  }\n\n  async function act(\n    companyId: string,\n    issueId: string,\n    request: RunnerGoalActionRequest,\n  ): Promise<RunnerGoalActionAccepted> {\n    const binding = await readBinding(companyId, issueId, request.agentId);\n    if (!binding) throw new RunnerGoalActionError(\"issue_not_found\", \"Issue not found.\");\n    if (!binding.agent) throw new RunnerGoalActionError(\"agent_not_found\", \"Agent not found.\");\n    if (binding.issue.assigneeAgentId !== request.agentId) {\n      throw new RunnerGoalActionError(\"agent_not_assigned\", \"The selected agent is not assigned to this issue.\");\n    }\n    const fallbackCapability = capabilityForAgent(binding.agent);\n    const initialProjection = await projection(companyId, issueId, request.agentId);\n    if (!initialProjection) throw new RunnerGoalActionError(\"issue_not_found\", \"Issue not found.\");\n    if (initialProjection.capability.availability !== \"available\") {\n      throw new RunnerGoalActionError(\n        initialProjection.capability.reasonCode ?? \"session_goals_unsupported\",\n        initialProjection.capability.reason ?? \"Session goals are unsupported.\",\n      );\n    }\n\n    const accepted = await db.transaction(async (tx) => {\n      await tx.insert(agentTaskSessions).values({\n        companyId,\n        agentId: request.agentId,\n        adapterType: binding.agent!.adapterType,\n        taskKey: issueId,\n      }).onConflictDoNothing();\n      const [session] = await tx.select().from(agentTaskSessions).where(and(\n        eq(agentTaskSessions.companyId, companyId),\n        eq(agentTaskSessions.agentId, request.agentId),\n        eq(agentTaskSessions.adapterType, binding.agent!.adapterType),\n        eq(agentTaskSessions.taskKey, issueId),\n      )).limit(1).for(\"update\");","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/runner-goals.ts#L348-L384","documentation":"Before accepting a goal action, `act` checks `initialProjection.capability.availability !== \"available\"` and throws `RunnerGoalActionError` with the capability's reasonCode, defaulting to `session_goals_unsupported`. This means the agent's adapter/session does not support session goals at all (or not right now).","triggerScenarios":"Calling set/pause/resume/clear goal actions against an agent whose adapter capability is not `available` and whose reasonCode is unset; adapters that don't implement goal control (e.g. adapters without session-goal support) always hit this path.","commonSituations":"Using an adapter type that lacks goal support; adapter feature flags disabled; capability probing failed during session startup so reasonCode falls back to the default; agent upgraded/downgraded between adapter versions with differing goal support.","solutions":["Check the projection's `capability.reason`/`reasonCode` first — it explains the specific unsupported reason","Only issue goal actions for agents/adapters that advertise session-goal capability (availability === 'available')","Re-probe capabilities: restart or re-establish the agent session so capability detection can run","Upgrade or fix the adapter implementation to support session goals"],"exampleFix":"// before\nawait runnerGoals.act(companyId, issueId, { agentId, action: 'set', goal: '...' });\n// after\nconst proj = await runnerGoals.projection(companyId, issueId, agentId);\nif (proj.capability.availability !== 'available') return; // read proj.capability.reason\nawait runnerGoals.act(companyId, issueId, { agentId, action: 'set', goal: '...' });","handlingStrategy":"fallback","validationCode":"const proj = await runnerGoals.projection(companyId, issueId, agentId);\nif (proj.capability.availability !== 'available') {\n  return { skipped: true, reason: proj.capability.reason ?? 'session goals unsupported' };\n}","typeGuard":"function goalsSupported(proj) {\n  return proj?.capability?.availability === 'available';\n}","tryCatchPattern":"try {\n  await runnerGoals.act(companyId, issueId, req);\n} catch (e) {\n  if (e instanceof RunnerGoalActionError && e.code === 'session_goals_unsupported') {\n    // degrade gracefully: skip goal management for this session\n  } else throw e;\n}","preventionTips":["Gate goal features on capability.availability === 'available'","Show goal controls only for goal-capable adapters","Re-probe capability after session restarts","Log capability.reason for diagnostics"],"tags":["capability","adapter","unsupported"],"backgroundTag":"unsupported-operation","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"}