跳到主要内容

任务详情

GET/research/worker/tasks/{id}在线调试
GET https://api.shengkezhi.com/open/v1/research/worker/tasks/experiment_20260701_001
等效 curl
curl "https://api.shengkezhi.com/open/v1/research/worker/tasks/experiment_20260701_001" \
  -H "Authorization: Bearer sk_xxx"

GET /research/worker/tasks/{id} — 任务详情。

需在请求头携带 Authorization: Bearer sk_xxx

请求参数

参数位置类型必填默认值说明
idpathstring-任务编号

响应 data

字段类型必填说明
errorstring | null失败时的错误信息;成功或尚未失败时为空。
idstring任务编号,后端生成(形如 task-3),前端用它轮询任务进度。
kindstring任务类型标识,如 workspace 初始化对应 workspace_init
progress_percentinteger | nullCopy jobs expose coarse byte progress; non-copy jobs leave it empty.
statusTaskStatus任务当前状态(queuedrunningsucceededfailed)。
user_idstring任务归属用户,取自网关注入的 X-Skz-User-Id;任务列表按此隔离。

TaskStatus 取值

取值说明
queued已入队等待,尚未拿到并发令牌,未开始执行。
running已拿到并发令牌,正在执行中。
succeeded执行成功完成。
failed执行失败(含任务内部 panic),失败原因见 error 字段。

调用示例

curl -X GET "https://api.shengkezhi.com/open/v1/research/worker/tasks/experiment_20260701_001" \
-H "Authorization: Bearer sk_xxx"
{
"code": 0,
"msg": "ok",
"data": {
"error": "示例Error",
"id": "experiment_20260701_001",
"kind": "示例Kind",
"progress_percent": 1,
"status": "queued",
"user_id": "a79dfc93b7e64a6cbbe26f2a787a6bad"
}
}```