fix(api): keep the worker's error on failed jobs, gate tracebacks behind --debug-api

Failed jobs now keep the worker's traceback, error_details and error_code instead of the "Worker exited" wrapper. error_traceback and worker_stderr only reach API clients under --debug-api.
This commit is contained in:
imSp4rky
2026-09-29 15:53:10 -06:00
parent 37e2b59bce
commit fdcc653b66
5 changed files with 74 additions and 10 deletions
+1 -1
View File
@@ -559,7 +559,7 @@ Show download jobs, with optional filtering and sorting.
}
```
With `full=true`, each job additionally includes `parameters` (with secrets redacted), `started_time`, `completed_time`, `output_files`, `error_message`, `error_details`, `error_code`, `error_traceback`, and `worker_stderr`.
With `full=true`, each job additionally includes `parameters` (with secrets redacted), `started_time`, `completed_time`, `output_files`, `error_message`, `error_details`, and `error_code`. When you start the server with `--debug-api`, each job also includes `error_traceback` and `worker_stderr`.
| Status | Error code | Meaning |
| --- | --- | --- |
+2 -2
View File
@@ -165,8 +165,8 @@ full detail:
| `input_prompt` | string or `null` | The prompt the service waits on. Answer it with `POST /api/download/jobs/{job_id}/input`. |
The full detail adds `started_time`, `completed_time`, `output_files`, the redacted
`parameters`, and, for failed jobs, `error_message`, `error_details`, `error_code`,
`error_traceback`, and `worker_stderr`.
`parameters`, and, for failed jobs, `error_message`, `error_details`, and `error_code`.
With `--debug-api`, it also adds `error_traceback` and `worker_stderr`.
!!! example "A typical polling loop"
```shell