---
title: "Diagnose Stuck State"
method: GET
path: "/admin/engagement/{engagement_id}/stuck-state"
tags: ["admin"]
---

# Diagnose Stuck State

`GET /admin/engagement/{engagement_id}/stuck-state`

## Request

- Base URL: `https://api-docs.upsmith.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api-docs.upsmith.com/admin/engagement/{engagement_id}/stuck-state`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Report whether this engagement is wedged on an orphan ext-mod write-ahead.

Matches the FatalError gate in ``agent-service/agent/runner/handler/run_requested.py``:
a stuck engagement has an ``EventAction.success IS NULL`` row AND a
matching dangling ``ToolCallPart`` in the most recent persisted
``ModelResponse``. When both hold the worker loops through DLQ on every
retry.

## Path parameters

- `engagement_id` string, required

## Headers

- `organization-id` string, nullable
- `timezone` string
- `x-user-id` string, nullable
- `x-actor-email` string, nullable
- `x-request-source` string, nullable
- `x-operation-id` string, nullable
- `x-commit-message` string, nullable
- `x-confirmation-id` string, nullable
- `x-chat-id` string, nullable

## Response `200`

Successful Response

- StuckStateResponse
  - `is_stuck` boolean, required
  - `orphan` OrphanWriteAhead
    - `event_action_id` string, required
    - `tool_name` string, required
    - `tool_call_id` string, required
    - `created_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

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