paperclipai/paperclip · error · RunnerGoalActionError

issue_not_found

issue_not_found

Error message

issue_not_found: Issue not found.

What it means

runner-goals `act` validates that the (companyId, issueId, agentId) triple resolves to an existing binding before executing a runner goal action. When readBinding finds no issue for that company/id it throws RunnerGoalActionError with code 'issue_not_found' — the API surface for 'this issue does not exist (or is not visible in this company)'.

Source

Thrown at server/src/services/runner-goals.ts:357

      adapterType: binding.agent.adapterType,
      sessionId: session?.id ?? null,
      capability: storedCapability(session, capabilityForAgent(binding.agent)),
      goal,
      workingNow: goal?.workingNow ?? false,
      activeRunId: activeRun?.id ?? null,
      pendingAction: projectedPendingAction,
      revision: session?.goalRevision ?? 0,
      observedAt: session?.goalObservedAt?.toISOString() ?? null,
    };
  }

  async function act(
    companyId: string,
    issueId: string,
    request: RunnerGoalActionRequest,
  ): Promise<RunnerGoalActionAccepted> {
    const binding = await readBinding(companyId, issueId, request.agentId);
    if (!binding) throw new RunnerGoalActionError("issue_not_found", "Issue not found.");
    if (!binding.agent) throw new RunnerGoalActionError("agent_not_found", "Agent not found.");
    if (binding.issue.assigneeAgentId !== request.agentId) {
      throw new RunnerGoalActionError("agent_not_assigned", "The selected agent is not assigned to this issue.");
    }
    const fallbackCapability = capabilityForAgent(binding.agent);
    const initialProjection = await projection(companyId, issueId, request.agentId);
    if (!initialProjection) throw new RunnerGoalActionError("issue_not_found", "Issue not found.");
    if (initialProjection.capability.availability !== "available") {
      throw new RunnerGoalActionError(
        initialProjection.capability.reasonCode ?? "session_goals_unsupported",
        initialProjection.capability.reason ?? "Session goals are unsupported.",
      );
    }

    const accepted = await db.transaction(async (tx) => {
      await tx.insert(agentTaskSessions).values({
        companyId,
        agentId: request.agentId,

View on GitHub (pinned to 01ad858492)

Solutions

  1. Verify the issueId exists via the issues list/get endpoint in the same company before acting
  2. Confirm the companyId in the request matches the company the issue belongs to
  3. Refresh the client's issue id from the server (stale cache) and retry
  4. Check for environment mix-ups (dev ids used against prod API)

Example fix

// before: acting on a possibly stale id
await act(companyId, issueId, request);
// after: resolve first
const issue = await getIssue(companyId, issueId);
if (!issue) throw new Error(`Issue ${issueId} not found in company ${companyId}`);
await act(companyId, issueId, request);
Defensive patterns

Strategy: try-catch

Validate before calling

const exists = await issueExists(companyId, issueId);
if (!exists) throw new Error(`Issue ${issueId} not found in company ${companyId}`);

Try / catch

try {
  await act(companyId, issueId, request);
} catch (e) {
  if (e instanceof RunnerGoalActionError && e.code === 'issue_not_found') {
    // refresh issue id / check companyId scope before retrying
  } else throw e;
}

Prevention

When it happens

Trigger: Calling the runner-goal action endpoint with an issueId that does not exist, was deleted, belongs to a different companyId than the one in the request path/auth scope, or a malformed id string.

Common situations: Client caching a stale issue id after the issue was deleted or merged; cross-company access where the agent passes an issue id from another company; copy-paste of an id from a different environment (dev vs prod); typo in the id.

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/c2919c2355e22e0f. Report an issue: GitHub.