Task 007 add agent job admin runner follow-up

This commit is contained in:
2026-05-21 19:33:24 +03:00
parent 4fd837349f
commit 8aa92ea728
16 changed files with 826 additions and 29 deletions
+419 -23
View File
@@ -19,6 +19,23 @@
"title": "AgentJobErrorCategory",
"type": "string"
},
"AgentJobListResponse": {
"additionalProperties": false,
"properties": {
"jobs": {
"items": {
"$ref": "#/components/schemas/AgentJobSummary"
},
"title": "Jobs",
"type": "array"
}
},
"required": [
"jobs"
],
"title": "AgentJobListResponse",
"type": "object"
},
"AgentJobOutput": {
"additionalProperties": false,
"properties": {
@@ -74,6 +91,19 @@
"title": "AgentJobOutput",
"type": "object"
},
"AgentJobResponse": {
"additionalProperties": false,
"properties": {
"job": {
"$ref": "#/components/schemas/AgentJobSummary"
}
},
"required": [
"job"
],
"title": "AgentJobResponse",
"type": "object"
},
"AgentJobStatus": {
"enum": [
"QUEUED",
@@ -94,9 +124,36 @@
"type": "string"
},
"article_id": {
"format": "uuid",
"title": "Article Id",
"type": "string"
"anyOf": [
{
"format": "uuid",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Article Id"
},
"attempt": {
"default": 1,
"minimum": 1,
"title": "Attempt",
"type": "integer"
},
"duration_ms": {
"anyOf": [
{
"minimum": 0,
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Duration Ms"
},
"error_category": {
"anyOf": [
@@ -121,6 +178,18 @@
"default": null,
"title": "Error Message"
},
"exit_code": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"default": null,
"title": "Exit Code"
},
"finished_at": {
"anyOf": [
{
@@ -156,6 +225,24 @@
"title": "Output Files",
"type": "array"
},
"parent_job_id": {
"anyOf": [
{
"format": "uuid",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Parent Job Id"
},
"queued_at": {
"format": "date-time",
"title": "Queued At",
"type": "string"
},
"started_at": {
"anyOf": [
{
@@ -172,6 +259,16 @@
"status": {
"$ref": "#/components/schemas/AgentJobStatus"
},
"stderr": {
"default": "",
"title": "Stderr",
"type": "string"
},
"stdout": {
"default": "",
"title": "Stdout",
"type": "string"
},
"workspace_path": {
"anyOf": [
{
@@ -187,14 +284,27 @@
},
"required": [
"id",
"article_id",
"job_type",
"agent_profile",
"status"
"status",
"queued_at"
],
"title": "AgentJobSummary",
"type": "object"
},
"AgentJobTestCodexRequest": {
"additionalProperties": false,
"properties": {
"fake_result": {
"default": "valid",
"pattern": "^(valid|invalid_schema)$",
"title": "Fake Result",
"type": "string"
}
},
"title": "AgentJobTestCodexRequest",
"type": "object"
},
"AgentJobType": {
"enum": [
"BOUNDARY_QUESTIONS",
@@ -1563,16 +1673,6 @@
"ScriptConfigVersionSummary": {
"additionalProperties": false,
"properties": {
"created_at": {
"format": "date-time",
"title": "Created At",
"type": "string"
},
"created_by": {
"format": "uuid",
"title": "Created By",
"type": "string"
},
"activated_at": {
"anyOf": [
{
@@ -1583,8 +1683,19 @@
"type": "null"
}
],
"default": null,
"title": "Activated At"
},
"created_at": {
"format": "date-time",
"title": "Created At",
"type": "string"
},
"created_by": {
"format": "uuid",
"title": "Created By",
"type": "string"
},
"diff": {
"additionalProperties": true,
"title": "Diff",
@@ -1600,14 +1711,6 @@
"title": "Publishing Yaml Hash",
"type": "string"
},
"status": {
"$ref": "#/components/schemas/ScriptConfigVersionStatus"
},
"target_site_id": {
"format": "uuid",
"title": "Target Site Id",
"type": "string"
},
"rollback_target_version_id": {
"anyOf": [
{
@@ -1618,8 +1721,17 @@
"type": "null"
}
],
"default": null,
"title": "Rollback Target Version Id"
},
"status": {
"$ref": "#/components/schemas/ScriptConfigVersionStatus"
},
"target_site_id": {
"format": "uuid",
"title": "Target Site Id",
"type": "string"
},
"transform_script_hash": {
"minLength": 1,
"title": "Transform Script Hash",
@@ -2116,6 +2228,290 @@
},
"openapi": "3.1.0",
"paths": {
"/api/agent-jobs": {
"get": {
"operationId": "get_agent_jobs_api_agent_jobs_get",
"parameters": [
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AgentJobListResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Get Agent Jobs",
"tags": [
"agent-jobs"
]
}
},
"/api/agent-jobs/test-codex": {
"post": {
"operationId": "post_test_codex_job_api_agent_jobs_test_codex_post",
"parameters": [
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AgentJobTestCodexRequest"
}
}
}
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AgentJobResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Post Test Codex Job",
"tags": [
"agent-jobs"
]
}
},
"/api/agent-jobs/{job_id}": {
"get": {
"operationId": "get_agent_job_route_api_agent_jobs__job_id__get",
"parameters": [
{
"in": "path",
"name": "job_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Job Id",
"type": "string"
}
},
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AgentJobResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Get Agent Job Route",
"tags": [
"agent-jobs"
]
}
},
"/api/agent-jobs/{job_id}/cancel": {
"post": {
"operationId": "post_cancel_agent_job_api_agent_jobs__job_id__cancel_post",
"parameters": [
{
"in": "path",
"name": "job_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Job Id",
"type": "string"
}
},
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AgentJobResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Post Cancel Agent Job",
"tags": [
"agent-jobs"
]
}
},
"/api/agent-jobs/{job_id}/retry": {
"post": {
"operationId": "post_retry_agent_job_api_agent_jobs__job_id__retry_post",
"parameters": [
{
"in": "path",
"name": "job_id",
"required": true,
"schema": {
"format": "uuid",
"title": "Job Id",
"type": "string"
}
},
{
"in": "header",
"name": "X-Demo-User-Email",
"required": false,
"schema": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "X-Demo-User-Email"
}
}
],
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/AgentJobResponse"
}
}
},
"description": "Successful Response"
},
"422": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
},
"description": "Validation Error"
}
},
"summary": "Post Retry Agent Job",
"tags": [
"agent-jobs"
]
}
},
"/api/articles": {
"get": {
"operationId": "list_articles_route_api_articles_get",