---
title: "Detect stalled run_jobs and surface them as Linear tickets"
method: POST
path: "/api/v1/internal/job-stalls"
tags: ["v1", "Internal"]
---

# Detect stalled run_jobs and surface them as Linear tickets

`POST /api/v1/internal/job-stalls`

## Request

- Base URL: `https://api.jeevyfabrication.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.jeevyfabrication.com/api/v1/internal/job-stalls`
- Auth: none declared

Run one stalled-job detection pass (JEEVY-900).

Called by the GitHub Actions cron. Nothing watched the job queue before this:
on 2026-07-24 a job sat ``running`` for 3 days 4 hours with every health
signal green, and it was found by accident.

**Error posture — the two failure kinds are deliberately NOT symmetric:**

- A **Linear** failure returns **200** with the counters. Filing is
  retryable (the claim survives with no issue id) and taking the endpoint
  down over it would convert a recoverable hiccup into a red herring.
- A **detection** failure returns **non-200**, always. If the query itself
  broke we do not know whether the queue is healthy, and answering 200 with
  ``stalledCount: 0`` would assert exactly the false all-clear this endpoint
  exists to prevent. The cron step fails the run on any non-200, so a broken
  detector shows up as a red run rather than a quiet green one.

## Headers

- `X-Internal-Key` string, nullable

## Response `200`

Successful Response

- JobStallSweepResponse: Outcome of one sweep.
  - `status` string
  - `checkedAt` string, required
  - `stalledCount` integer
  - `totalStalled` integer
  - `truncated` boolean
  - `newlyFiled` integer
  - `escalated` integer
  - `resolved` integer
  - `unfiledBacklog` integer
  - `aggregated` boolean
  - `filingEnabled` boolean
  - `filingBlockedReason` string, nullable
  - `unknownJobTypes` string[]
  - `findings` JobStallFinding[]
    - `jobId` string, required
    - `runId` string, nullable
    - `deliverableId` string, nullable
    - `jobType` string, nullable
    - `status` string, nullable
    - `workerId` string, nullable
    - `attemptNo` integer, nullable
    - `ageSeconds` integer, nullable
    - `thresholdSeconds` integer, nullable
    - `createdAt` unknown
    - `leaseExpiresAt` unknown

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-20** `9eebba4f395d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api/changes/api/v1/internal/job-stalls/post.md)

---

[API](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api.md) - [All operations](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api/revisions/ad9a01abeac9?raw)
