Skip to content

Commit 2bb4fdc

Browse files
authored
deepsearch/api: remove 'failed' conversation status (#1457)
This status doesn't exist. After poking at it for a while in sourcegraph/sourcegraph#7964 I've decided the change is a bit too pervasive (since we store external API shape directly into DB), and it's probably better to just fix the docs. Sadly, it looks like there's no published schema for this, so I also added what the error behaviour is supposed to be. Part of https://linear.app/sourcegraph/issue/CU-1495/api-housekeeping
1 parent 1019b10 commit 2bb4fdc

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

docs/deep-search/api.mdx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,27 @@ curl 'https://your-sourcegraph-instance.com/.api/deepsearch/v1?filter_read_token
257257

258258
- `id` - Unique question identifier
259259
- `question` - The original question text
260-
- `status` - Processing status: `pending`, `processing`, `completed`, `failed`
260+
- `status` - Processing status: `pending`, `processing`, `completed`
261+
- `error` - Error details if the question processing encountered an issue
261262
- `title` - Generated title for the question
262263
- `answer` - The AI-generated answer (when completed)
263264
- `sources` - Array of sources used to generate the answer
264265
- `suggested_followups` - Suggested follow-up questions
265266

267+
If a question fails to process, the `status` will be `completed` and the `error` field will be populated, for example:
268+
269+
```json
270+
{
271+
"status": "completed",
272+
"error": {
273+
"title": "Token limit reached",
274+
"kind": "TokenLimitExceeded",
275+
"message": "The search exceeded the maximum token limit...",
276+
"details": "Additional context about the error"
277+
}
278+
}
279+
```
280+
266281
## Error handling
267282

268283
The API returns standard HTTP status codes with descriptive error messages:

0 commit comments

Comments
 (0)