Skip to content

Conversation

@ultmaster
Copy link
Contributor

@ultmaster ultmaster commented Nov 5, 2025

  1. /agl/v1 to /v1/agl.
  2. Reserved OTLP endpoints: https://opentelemetry.io/docs/specs/otlp/#otlphttp-request
  3. Allow CORS
  4. Use portpicker to fix flaky tests
  5. Support resource filtering
Copilot AI review requested due to automatic review settings November 5, 2025 04:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the LightningStore server with CORS support, resource filtering capabilities, improved port selection, and OTLP endpoint stubs. The main changes involve API versioning adjustments, CORS configuration, replacing manual port selection with the portpicker library, and adding resource query filters.

Key changes:

  • API prefix changed from /agl/v1 to /v1/agl for better OpenTelemetry compatibility
  • Added CORS middleware support with configurable origins
  • Replaced custom _get_free_port() with portpicker.pick_unused_port()
  • Added resource filtering by resources_id and resources_id_contains
  • Added stub endpoints for OTLP traces, metrics, logs, and development profiles

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
uv.lock Added portpicker 1.6.0 dependency and greenlet wheels for musllinux_1_2 platforms
pyproject.toml Added portpicker to project dependencies
agentlightning/store/client_server.py Changed API prefix, added CORS middleware, added resource filtering, and OTLP stub endpoints
agentlightning/cli/store.py Added --cors-origin CLI argument for CORS configuration
tests/store/test_restful.py Replaced custom port function with portpicker, added CORS and resource filtering tests
tests/store/test_client_server.py Replaced custom port function with portpicker throughout tests
docs/assets/store-openapi.json Updated OpenAPI spec with new API prefix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1 +1 @@
{"openapi": "3.1.0", "info": {"title": "LightningStore Server", "version": "0.1.0"}, "paths": {"/agl/v1/health": {"get": {"summary": "Health", "operationId": "health_agl_v1_health_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/agl/v1/queues/rollouts/enqueue": {"post": {"summary": "Enqueue Rollout", "operationId": "enqueue_rollout_agl_v1_queues_rollouts_enqueue_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/RolloutRequest"}}}, "required": true}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Rollout"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/agl/v1/queues/rollouts/dequeue": {"post": {"summary": "Dequeue Rollout", "operationId": "dequeue_rollout_agl_v1_queues_rollouts_dequeue_post", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/AttemptedRollout"}, {"type": "null"}], "title": "Response Dequeue Rollout Agl V1 Queues Rollouts Dequeue Post"}}}}}}}, "/agl/v1/rollouts": {"post": {"summary": "Start Rollout", "operationId": "start_rollout_agl_v1_rollouts_post", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RolloutRequest"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AttemptedRollout"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"summary": "Query Rollouts", "operationId": "query_rollouts_agl_v1_rollouts_get", "parameters": [{"name": "status_in", "in": "query", "required": false, "schema": {"anyOf": [{"type": "array", "items": {"enum": ["queuing", "preparing", "running", "failed", "succeeded", "cancelled", "requeuing"], "type": "string"}}, {"type": "null"}], "title": "Status In"}}, {"name": "rollout_id_in", "in": "query", "required": false, "schema": {"anyOf": [{"type": "array", "items": {"type": "string"}}, {"type": "null"}], "title": "Rollout Id In"}}, {"name": "rollout_id_contains", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Rollout Id Contains"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "default": -1, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "default": 0, "title": "Offset"}}, {"name": "sort_by", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Sort By"}}, {"name": "sort_order", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "default": "asc", "title": "Sort Order"}}, {"name": "filter_logic", "in": "query", "required": false, "schema": {"enum": ["and", "or"], "type": "string", "default": "and", "title": "Filter Logic"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaginatedResponse_Rollout_"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/agl/v1/rollouts/{rollout_id}": {"get": {"summary": "Get Rollout By Id", "operationId": "get_rollout_by_id_agl_v1_rollouts__rollout_id__get", "parameters": [{"name": "rollout_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Rollout Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Rollout"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"summary": "Update Rollout", "operationId": "update_rollout_agl_v1_rollouts__rollout_id__post", "parameters": [{"name": "rollout_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Rollout Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateRolloutRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Rollout"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/agl/v1/rollouts/{rollout_id}/attempts": {"post": {"summary": "Start Attempt", "operationId": "start_attempt_agl_v1_rollouts__rollout_id__attempts_post", "parameters": [{"name": "rollout_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Rollout Id"}}], "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AttemptedRollout"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"summary": "Query Attempts", "operationId": "query_attempts_agl_v1_rollouts__rollout_id__attempts_get", "parameters": [{"name": "rollout_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Rollout Id"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "default": -1, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "default": 0, "title": "Offset"}}, {"name": "sort_by", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Sort By"}}, {"name": "sort_order", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "default": "asc", "title": "Sort Order"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaginatedResponse_Attempt_"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/agl/v1/rollouts/{rollout_id}/attempts/{attempt_id}": {"post": {"summary": "Update Attempt", "operationId": "update_attempt_agl_v1_rollouts__rollout_id__attempts__attempt_id__post", "parameters": [{"name": "rollout_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Rollout Id"}}, {"name": "attempt_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Attempt Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateAttemptRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Attempt"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/agl/v1/rollouts/{rollout_id}/attempts/latest": {"get": {"summary": "Get Latest Attempt", "operationId": "get_latest_attempt_agl_v1_rollouts__rollout_id__attempts_latest_get", "parameters": [{"name": "rollout_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Rollout Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/Attempt"}, {"type": "null"}], "title": "Response Get Latest Attempt Agl V1 Rollouts Rollout Id Attempts Latest Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/agl/v1/resources": {"get": {"summary": "Query Resources", "operationId": "query_resources_agl_v1_resources_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "default": -1, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "default": 0, "title": "Offset"}}, {"name": "sort_by", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Sort By"}}, {"name": "sort_order", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "default": "asc", "title": "Sort Order"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaginatedResponse_ResourcesUpdate_"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"summary": "Add Resources", "operationId": "add_resources_agl_v1_resources_post", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": {"oneOf": [{"$ref": "#/components/schemas/LLM"}, {"$ref": "#/components/schemas/ProxyLLM"}, {"$ref": "#/components/schemas/PromptTemplate"}], "discriminator": {"propertyName": "resource_type", "mapping": {"llm": "#/components/schemas/LLM", "proxy_llm": "#/components/schemas/ProxyLLM", "prompt_template": "#/components/schemas/PromptTemplate"}}}, "title": "Resources"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ResourcesUpdate"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/agl/v1/resources/latest": {"get": {"summary": "Get Latest Resources", "operationId": "get_latest_resources_agl_v1_resources_latest_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/ResourcesUpdate"}, {"type": "null"}], "title": "Response Get Latest Resources Agl V1 Resources Latest Get"}}}}}}}, "/agl/v1/resources/{resources_id}": {"post": {"summary": "Update Resources", "operationId": "update_resources_agl_v1_resources__resources_id__post", "parameters": [{"name": "resources_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Resources Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": {"oneOf": [{"$ref": "#/components/schemas/LLM"}, {"$ref": "#/components/schemas/ProxyLLM"}, {"$ref": "#/components/schemas/PromptTemplate"}], "discriminator": {"propertyName": "resource_type", "mapping": {"llm": "#/components/schemas/LLM", "proxy_llm": "#/components/schemas/ProxyLLM", "prompt_template": "#/components/schemas/PromptTemplate"}}}, "title": "Resources"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ResourcesUpdate"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"summary": "Get Resources By Id", "operationId": "get_resources_by_id_agl_v1_resources__resources_id__get", "parameters": [{"name": "resources_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Resources Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/ResourcesUpdate"}, {"type": "null"}], "title": "Response Get Resources By Id Agl V1 Resources Resources Id Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/agl/v1/spans": {"post": {"summary": "Add Span", "operationId": "add_span_agl_v1_spans_post", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Span-Input"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Span-Output"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"summary": "Query Spans", "operationId": "query_spans_agl_v1_spans_get", "parameters": [{"name": "rollout_id", "in": "query", "required": true, "schema": {"type": "string", "title": "Rollout Id"}}, {"name": "attempt_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Attempt Id"}}, {"name": "trace_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Trace Id"}}, {"name": "trace_id_contains", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Trace Id Contains"}}, {"name": "span_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Span Id"}}, {"name": "span_id_contains", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Span Id Contains"}}, {"name": "parent_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Parent Id"}}, {"name": "parent_id_contains", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Parent Id Contains"}}, {"name": "name", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}}, {"name": "name_contains", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name Contains"}}, {"name": "filter_logic", "in": "query", "required": false, "schema": {"enum": ["and", "or"], "type": "string", "default": "and", "title": "Filter Logic"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "default": -1, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "default": 0, "title": "Offset"}}, {"name": "sort_by", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Sort By"}}, {"name": "sort_order", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "default": "asc", "title": "Sort Order"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaginatedResponse_Span_"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/agl/v1/spans/next": {"post": {"summary": "Get Next Span Sequence Id", "operationId": "get_next_span_sequence_id_agl_v1_spans_next_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/NextSequenceIdRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/NextSequenceIdResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/agl/v1/waits/rollouts": {"post": {"summary": "Wait For Rollouts", "operationId": "wait_for_rollouts_agl_v1_waits_rollouts_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WaitForRolloutsRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/Rollout"}, "type": "array", "title": "Response Wait For Rollouts Agl V1 Waits Rollouts Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}}, "components": {"schemas": {"Attempt": {"properties": {"rollout_id": {"type": "string", "title": "Rollout Id"}, "attempt_id": {"type": "string", "title": "Attempt Id"}, "sequence_id": {"type": "integer", "title": "Sequence Id"}, "start_time": {"type": "number", "title": "Start Time"}, "end_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "End Time"}, "status": {"type": "string", "enum": ["preparing", "running", "failed", "succeeded", "unresponsive", "timeout"], "title": "Status", "default": "preparing"}, "worker_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Worker Id"}, "last_heartbeat_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Last Heartbeat Time"}, "metadata": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Metadata"}}, "type": "object", "required": ["rollout_id", "attempt_id", "sequence_id", "start_time"], "title": "Attempt", "description": "Execution attempt for a rollout, including metadata for retries."}, "AttemptedRollout": {"properties": {"rollout_id": {"type": "string", "title": "Rollout Id"}, "input": {"title": "Input"}, "start_time": {"type": "number", "title": "Start Time"}, "end_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "End Time"}, "mode": {"anyOf": [{"type": "string", "enum": ["train", "val", "test"]}, {"type": "null"}], "title": "Mode"}, "resources_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Resources Id"}, "status": {"type": "string", "enum": ["queuing", "preparing", "running", "failed", "succeeded", "cancelled", "requeuing"], "title": "Status", "default": "queuing"}, "config": {"$ref": "#/components/schemas/RolloutConfig"}, "metadata": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Metadata"}, "attempt": {"$ref": "#/components/schemas/Attempt"}}, "type": "object", "required": ["rollout_id", "input", "start_time", "attempt"], "title": "AttemptedRollout", "description": "Rollout paired with the currently active attempt."}, "Event": {"properties": {"name": {"type": "string", "title": "Name"}, "attributes": {"additionalProperties": {"anyOf": [{"type": "string"}, {"type": "boolean"}, {"type": "integer"}, {"type": "number"}, {"items": {"type": "string"}, "type": "array"}, {"items": {"type": "boolean"}, "type": "array"}, {"items": {"type": "integer"}, "type": "array"}, {"items": {"type": "number"}, "type": "array"}]}, "type": "object", "title": "Attributes"}, "timestamp": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Timestamp"}}, "additionalProperties": true, "type": "object", "required": ["name", "attributes"], "title": "Event", "description": "Serializable representation of OpenTelemetry `Event` values."}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "LLM": {"properties": {"resource_type": {"type": "string", "const": "llm", "title": "Resource Type", "default": "llm"}, "endpoint": {"type": "string", "title": "Endpoint"}, "model": {"type": "string", "title": "Model"}, "api_key": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Api Key"}, "sampling_parameters": {"additionalProperties": true, "type": "object", "title": "Sampling Parameters"}}, "type": "object", "required": ["endpoint", "model"], "title": "LLM", "description": "Resource that identifies an LLM endpoint and its configuration."}, "Link": {"properties": {"context": {"$ref": "#/components/schemas/SpanContext"}, "attributes": {"anyOf": [{"additionalProperties": {"anyOf": [{"type": "string"}, {"type": "boolean"}, {"type": "integer"}, {"type": "number"}, {"items": {"type": "string"}, "type": "array"}, {"items": {"type": "boolean"}, "type": "array"}, {"items": {"type": "integer"}, "type": "array"}, {"items": {"type": "number"}, "type": "array"}]}, "type": "object"}, {"type": "null"}], "title": "Attributes"}}, "additionalProperties": true, "type": "object", "required": ["context"], "title": "Link", "description": "Serializable representation of OpenTelemetry `Link` values."}, "NextSequenceIdRequest": {"properties": {"rollout_id": {"type": "string", "title": "Rollout Id"}, "attempt_id": {"type": "string", "title": "Attempt Id"}}, "type": "object", "required": ["rollout_id", "attempt_id"], "title": "NextSequenceIdRequest"}, "NextSequenceIdResponse": {"properties": {"sequence_id": {"type": "integer", "title": "Sequence Id"}}, "type": "object", "required": ["sequence_id"], "title": "NextSequenceIdResponse"}, "OtelResource": {"properties": {"attributes": {"additionalProperties": {"anyOf": [{"type": "string"}, {"type": "boolean"}, {"type": "integer"}, {"type": "number"}, {"items": {"type": "string"}, "type": "array"}, {"items": {"type": "boolean"}, "type": "array"}, {"items": {"type": "integer"}, "type": "array"}, {"items": {"type": "number"}, "type": "array"}]}, "type": "object", "title": "Attributes"}, "schema_url": {"type": "string", "title": "Schema Url"}}, "type": "object", "required": ["attributes", "schema_url"], "title": "OtelResource", "description": "Serializable representation of OpenTelemetry `Resource` values.\n\nNamed as `OtelResource` to avoid confusion with the [`Resource`][agentlightning.Resource] class.\nUsers will very rarely need to construct this class directly. Most of the times,\nthey deal with the [`Resource`][agentlightning.Resource] class instead, which describes\na very different concept."}, "PaginatedResponse_Attempt_": {"properties": {"items": {"items": {"$ref": "#/components/schemas/Attempt"}, "type": "array", "title": "Items"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}, "total": {"type": "integer", "title": "Total"}}, "type": "object", "required": ["items", "limit", "offset", "total"], "title": "PaginatedResponse[Attempt]"}, "PaginatedResponse_ResourcesUpdate_": {"properties": {"items": {"items": {"$ref": "#/components/schemas/ResourcesUpdate"}, "type": "array", "title": "Items"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}, "total": {"type": "integer", "title": "Total"}}, "type": "object", "required": ["items", "limit", "offset", "total"], "title": "PaginatedResponse[ResourcesUpdate]"}, "PaginatedResponse_Rollout_": {"properties": {"items": {"items": {"$ref": "#/components/schemas/Rollout"}, "type": "array", "title": "Items"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}, "total": {"type": "integer", "title": "Total"}}, "type": "object", "required": ["items", "limit", "offset", "total"], "title": "PaginatedResponse[Rollout]"}, "PaginatedResponse_Span_": {"properties": {"items": {"items": {"$ref": "#/components/schemas/Span-Output"}, "type": "array", "title": "Items"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}, "total": {"type": "integer", "title": "Total"}}, "type": "object", "required": ["items", "limit", "offset", "total"], "title": "PaginatedResponse[Span]"}, "PromptTemplate": {"properties": {"resource_type": {"type": "string", "const": "prompt_template", "title": "Resource Type", "default": "prompt_template"}, "template": {"type": "string", "title": "Template"}, "engine": {"type": "string", "enum": ["jinja", "f-string", "poml"], "title": "Engine"}}, "type": "object", "required": ["template", "engine"], "title": "PromptTemplate", "description": "Resource describing a reusable prompt template."}, "ProxyLLM": {"properties": {"resource_type": {"type": "string", "const": "proxy_llm", "title": "Resource Type", "default": "proxy_llm"}, "endpoint": {"type": "string", "title": "Endpoint"}, "model": {"type": "string", "title": "Model"}, "api_key": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Api Key"}, "sampling_parameters": {"additionalProperties": true, "type": "object", "title": "Sampling Parameters"}}, "type": "object", "required": ["endpoint", "model"], "title": "ProxyLLM", "description": "LLM resource that rewrites endpoints through [`LLMProxy`][agentlightning.LLMProxy].\n\nThe proxy injects rollout- and attempt-specific routing information into the\nendpoint so that downstream services can attribute requests correctly."}, "ResourcesUpdate": {"properties": {"resources_id": {"type": "string", "title": "Resources Id"}, "create_time": {"type": "number", "title": "Create Time"}, "update_time": {"type": "number", "title": "Update Time"}, "version": {"type": "integer", "title": "Version"}, "resources": {"additionalProperties": {"oneOf": [{"$ref": "#/components/schemas/LLM"}, {"$ref": "#/components/schemas/ProxyLLM"}, {"$ref": "#/components/schemas/PromptTemplate"}], "discriminator": {"propertyName": "resource_type", "mapping": {"llm": "#/components/schemas/LLM", "prompt_template": "#/components/schemas/PromptTemplate", "proxy_llm": "#/components/schemas/ProxyLLM"}}}, "type": "object", "title": "Resources"}}, "type": "object", "required": ["resources_id", "create_time", "update_time", "version", "resources"], "title": "ResourcesUpdate", "description": "Update payload broadcast to clients when resources change."}, "Rollout": {"properties": {"rollout_id": {"type": "string", "title": "Rollout Id"}, "input": {"title": "Input"}, "start_time": {"type": "number", "title": "Start Time"}, "end_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "End Time"}, "mode": {"anyOf": [{"type": "string", "enum": ["train", "val", "test"]}, {"type": "null"}], "title": "Mode"}, "resources_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Resources Id"}, "status": {"type": "string", "enum": ["queuing", "preparing", "running", "failed", "succeeded", "cancelled", "requeuing"], "title": "Status", "default": "queuing"}, "config": {"$ref": "#/components/schemas/RolloutConfig"}, "metadata": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Metadata"}}, "type": "object", "required": ["rollout_id", "input", "start_time"], "title": "Rollout"}, "RolloutConfig": {"properties": {"timeout_seconds": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Timeout Seconds"}, "unresponsive_seconds": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Unresponsive Seconds"}, "max_attempts": {"type": "integer", "minimum": 1.0, "title": "Max Attempts", "default": 1}, "retry_condition": {"items": {"type": "string", "enum": ["preparing", "running", "failed", "succeeded", "unresponsive", "timeout"]}, "type": "array", "title": "Retry Condition"}}, "type": "object", "title": "RolloutConfig", "description": "Configuration controlling rollout retries and timeouts."}, "RolloutRequest": {"properties": {"input": {"title": "Input"}, "mode": {"anyOf": [{"type": "string", "enum": ["train", "val", "test"]}, {"type": "null"}], "title": "Mode"}, "resources_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Resources Id"}, "config": {"anyOf": [{"$ref": "#/components/schemas/RolloutConfig"}, {"type": "null"}]}, "metadata": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Metadata"}}, "type": "object", "required": ["input"], "title": "RolloutRequest"}, "Span-Input": {"properties": {"rollout_id": {"type": "string", "title": "Rollout Id"}, "attempt_id": {"type": "string", "title": "Attempt Id"}, "sequence_id": {"type": "integer", "title": "Sequence Id"}, "trace_id": {"type": "string", "title": "Trace Id"}, "span_id": {"type": "string", "title": "Span Id"}, "parent_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Parent Id"}, "name": {"type": "string", "title": "Name"}, "status": {"$ref": "#/components/schemas/TraceStatus"}, "attributes": {"additionalProperties": {"anyOf": [{"type": "string"}, {"type": "boolean"}, {"type": "integer"}, {"type": "number"}, {"items": {"type": "string"}, "type": "array"}, {"items": {"type": "boolean"}, "type": "array"}, {"items": {"type": "integer"}, "type": "array"}, {"items": {"type": "number"}, "type": "array"}]}, "type": "object", "title": "Attributes"}, "events": {"items": {"$ref": "#/components/schemas/Event"}, "type": "array", "title": "Events"}, "links": {"items": {"$ref": "#/components/schemas/Link"}, "type": "array", "title": "Links"}, "start_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Start Time"}, "end_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "End Time"}, "context": {"anyOf": [{"$ref": "#/components/schemas/SpanContext"}, {"type": "null"}]}, "parent": {"anyOf": [{"$ref": "#/components/schemas/SpanContext"}, {"type": "null"}]}, "resource": {"$ref": "#/components/schemas/OtelResource"}}, "additionalProperties": true, "type": "object", "required": ["rollout_id", "attempt_id", "sequence_id", "trace_id", "span_id", "parent_id", "name", "status", "attributes", "events", "links", "start_time", "end_time", "context", "parent", "resource"], "title": "Span", "description": "Agent Lightning's canonical span model used for persistence and analytics.\n\nThe model captures the most relevant fields from\n`opentelemetry.sdk.trace.ReadableSpan` instances while preserving unmodeled\nattributes in Pydantic `BaseModel`'s extra storage. This keeps the serialized format\nstable even as upstream OpenTelemetry types evolve."}, "Span-Output": {"properties": {"rollout_id": {"type": "string", "title": "Rollout Id"}, "attempt_id": {"type": "string", "title": "Attempt Id"}, "sequence_id": {"type": "integer", "title": "Sequence Id"}, "trace_id": {"type": "string", "title": "Trace Id"}, "span_id": {"type": "string", "title": "Span Id"}, "parent_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Parent Id"}, "name": {"type": "string", "title": "Name"}, "status": {"$ref": "#/components/schemas/TraceStatus"}, "attributes": {"additionalProperties": {"anyOf": [{"type": "string"}, {"type": "boolean"}, {"type": "integer"}, {"type": "number"}, {"items": {"type": "string"}, "type": "array"}, {"items": {"type": "boolean"}, "type": "array"}, {"items": {"type": "integer"}, "type": "array"}, {"items": {"type": "number"}, "type": "array"}]}, "type": "object", "title": "Attributes"}, "events": {"items": {"$ref": "#/components/schemas/Event"}, "type": "array", "title": "Events"}, "links": {"items": {"$ref": "#/components/schemas/Link"}, "type": "array", "title": "Links"}, "start_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Start Time"}, "end_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "End Time"}, "context": {"anyOf": [{"$ref": "#/components/schemas/SpanContext"}, {"type": "null"}]}, "parent": {"anyOf": [{"$ref": "#/components/schemas/SpanContext"}, {"type": "null"}]}, "resource": {"$ref": "#/components/schemas/OtelResource"}}, "additionalProperties": true, "type": "object", "required": ["rollout_id", "attempt_id", "sequence_id", "trace_id", "span_id", "parent_id", "name", "status", "attributes", "events", "links", "start_time", "end_time", "context", "parent", "resource"], "title": "Span", "description": "Agent Lightning's canonical span model used for persistence and analytics.\n\nThe model captures the most relevant fields from\n`opentelemetry.sdk.trace.ReadableSpan` instances while preserving unmodeled\nattributes in Pydantic `BaseModel`'s extra storage. This keeps the serialized format\nstable even as upstream OpenTelemetry types evolve."}, "SpanContext": {"properties": {"trace_id": {"type": "string", "title": "Trace Id"}, "span_id": {"type": "string", "title": "Span Id"}, "is_remote": {"type": "boolean", "title": "Is Remote"}, "trace_state": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Trace State"}}, "additionalProperties": true, "type": "object", "required": ["trace_id", "span_id", "is_remote", "trace_state"], "title": "SpanContext", "description": "Pydantic representation of `opentelemetry.trace.SpanContext` values."}, "TraceStatus": {"properties": {"status_code": {"type": "string", "title": "Status Code"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}}, "additionalProperties": true, "type": "object", "required": ["status_code"], "title": "TraceStatus", "description": "Serializable variant of `opentelemetry.trace.Status`."}, "UpdateAttemptRequest": {"properties": {"status": {"anyOf": [{"type": "string", "enum": ["preparing", "running", "failed", "succeeded", "unresponsive", "timeout"]}, {"type": "null"}], "title": "Status"}, "worker_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Worker Id"}, "last_heartbeat_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Last Heartbeat Time"}, "metadata": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Metadata"}}, "type": "object", "title": "UpdateAttemptRequest"}, "UpdateRolloutRequest": {"properties": {"input": {"anyOf": [{}, {"type": "null"}], "title": "Input"}, "mode": {"anyOf": [{"type": "string", "enum": ["train", "val", "test"]}, {"type": "null"}], "title": "Mode"}, "resources_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Resources Id"}, "status": {"anyOf": [{"type": "string", "enum": ["queuing", "preparing", "running", "failed", "succeeded", "cancelled", "requeuing"]}, {"type": "null"}], "title": "Status"}, "config": {"anyOf": [{"$ref": "#/components/schemas/RolloutConfig"}, {"type": "null"}]}, "metadata": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Metadata"}}, "type": "object", "title": "UpdateRolloutRequest"}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}, "WaitForRolloutsRequest": {"properties": {"rollout_ids": {"items": {"type": "string"}, "type": "array", "title": "Rollout Ids"}, "timeout": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Timeout"}}, "type": "object", "required": ["rollout_ids"], "title": "WaitForRolloutsRequest"}}}}
{"openapi": "3.1.0", "info": {"title": "LightningStore Server", "version": "0.1.0"}, "paths": {"/v1/agl/health": {"get": {"summary": "Health", "operationId": "health_agl_v1_health_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {}}}}}}}, "/v1/agl/queues/rollouts/enqueue": {"post": {"summary": "Enqueue Rollout", "operationId": "enqueue_rollout_agl_v1_queues_rollouts_enqueue_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/RolloutRequest"}}}, "required": true}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Rollout"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/v1/agl/queues/rollouts/dequeue": {"post": {"summary": "Dequeue Rollout", "operationId": "dequeue_rollout_agl_v1_queues_rollouts_dequeue_post", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/AttemptedRollout"}, {"type": "null"}], "title": "Response Dequeue Rollout Agl V1 Queues Rollouts Dequeue Post"}}}}}}}, "/v1/agl/rollouts": {"post": {"summary": "Start Rollout", "operationId": "start_rollout_agl_v1_rollouts_post", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/RolloutRequest"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AttemptedRollout"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"summary": "Query Rollouts", "operationId": "query_rollouts_agl_v1_rollouts_get", "parameters": [{"name": "status_in", "in": "query", "required": false, "schema": {"anyOf": [{"type": "array", "items": {"enum": ["queuing", "preparing", "running", "failed", "succeeded", "cancelled", "requeuing"], "type": "string"}}, {"type": "null"}], "title": "Status In"}}, {"name": "rollout_id_in", "in": "query", "required": false, "schema": {"anyOf": [{"type": "array", "items": {"type": "string"}}, {"type": "null"}], "title": "Rollout Id In"}}, {"name": "rollout_id_contains", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Rollout Id Contains"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "default": -1, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "default": 0, "title": "Offset"}}, {"name": "sort_by", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Sort By"}}, {"name": "sort_order", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "default": "asc", "title": "Sort Order"}}, {"name": "filter_logic", "in": "query", "required": false, "schema": {"enum": ["and", "or"], "type": "string", "default": "and", "title": "Filter Logic"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaginatedResponse_Rollout_"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/v1/agl/rollouts/{rollout_id}": {"get": {"summary": "Get Rollout By Id", "operationId": "get_rollout_by_id_agl_v1_rollouts__rollout_id__get", "parameters": [{"name": "rollout_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Rollout Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Rollout"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"summary": "Update Rollout", "operationId": "update_rollout_agl_v1_rollouts__rollout_id__post", "parameters": [{"name": "rollout_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Rollout Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateRolloutRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Rollout"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/v1/agl/rollouts/{rollout_id}/attempts": {"post": {"summary": "Start Attempt", "operationId": "start_attempt_agl_v1_rollouts__rollout_id__attempts_post", "parameters": [{"name": "rollout_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Rollout Id"}}], "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AttemptedRollout"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"summary": "Query Attempts", "operationId": "query_attempts_agl_v1_rollouts__rollout_id__attempts_get", "parameters": [{"name": "rollout_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Rollout Id"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "default": -1, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "default": 0, "title": "Offset"}}, {"name": "sort_by", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Sort By"}}, {"name": "sort_order", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "default": "asc", "title": "Sort Order"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaginatedResponse_Attempt_"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/v1/agl/rollouts/{rollout_id}/attempts/{attempt_id}": {"post": {"summary": "Update Attempt", "operationId": "update_attempt_agl_v1_rollouts__rollout_id__attempts__attempt_id__post", "parameters": [{"name": "rollout_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Rollout Id"}}, {"name": "attempt_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Attempt Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/UpdateAttemptRequest"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Attempt"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/v1/agl/rollouts/{rollout_id}/attempts/latest": {"get": {"summary": "Get Latest Attempt", "operationId": "get_latest_attempt_agl_v1_rollouts__rollout_id__attempts_latest_get", "parameters": [{"name": "rollout_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Rollout Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/Attempt"}, {"type": "null"}], "title": "Response Get Latest Attempt Agl V1 Rollouts Rollout Id Attempts Latest Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/v1/agl/resources": {"get": {"summary": "Query Resources", "operationId": "query_resources_agl_v1_resources_get", "parameters": [{"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "default": -1, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "default": 0, "title": "Offset"}}, {"name": "sort_by", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Sort By"}}, {"name": "sort_order", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "default": "asc", "title": "Sort Order"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaginatedResponse_ResourcesUpdate_"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "post": {"summary": "Add Resources", "operationId": "add_resources_agl_v1_resources_post", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": {"oneOf": [{"$ref": "#/components/schemas/LLM"}, {"$ref": "#/components/schemas/ProxyLLM"}, {"$ref": "#/components/schemas/PromptTemplate"}], "discriminator": {"propertyName": "resource_type", "mapping": {"llm": "#/components/schemas/LLM", "proxy_llm": "#/components/schemas/ProxyLLM", "prompt_template": "#/components/schemas/PromptTemplate"}}}, "title": "Resources"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ResourcesUpdate"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/v1/agl/resources/latest": {"get": {"summary": "Get Latest Resources", "operationId": "get_latest_resources_agl_v1_resources_latest_get", "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/ResourcesUpdate"}, {"type": "null"}], "title": "Response Get Latest Resources Agl V1 Resources Latest Get"}}}}}}}, "/v1/agl/resources/{resources_id}": {"post": {"summary": "Update Resources", "operationId": "update_resources_agl_v1_resources__resources_id__post", "parameters": [{"name": "resources_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Resources Id"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "additionalProperties": {"oneOf": [{"$ref": "#/components/schemas/LLM"}, {"$ref": "#/components/schemas/ProxyLLM"}, {"$ref": "#/components/schemas/PromptTemplate"}], "discriminator": {"propertyName": "resource_type", "mapping": {"llm": "#/components/schemas/LLM", "proxy_llm": "#/components/schemas/ProxyLLM", "prompt_template": "#/components/schemas/PromptTemplate"}}}, "title": "Resources"}}}}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ResourcesUpdate"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"summary": "Get Resources By Id", "operationId": "get_resources_by_id_agl_v1_resources__resources_id__get", "parameters": [{"name": "resources_id", "in": "path", "required": true, "schema": {"type": "string", "title": "Resources Id"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"anyOf": [{"$ref": "#/components/schemas/ResourcesUpdate"}, {"type": "null"}], "title": "Response Get Resources By Id Agl V1 Resources Resources Id Get"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/v1/agl/spans": {"post": {"summary": "Add Span", "operationId": "add_span_agl_v1_spans_post", "requestBody": {"required": true, "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Span-Input"}}}}, "responses": {"201": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Span-Output"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}, "get": {"summary": "Query Spans", "operationId": "query_spans_agl_v1_spans_get", "parameters": [{"name": "rollout_id", "in": "query", "required": true, "schema": {"type": "string", "title": "Rollout Id"}}, {"name": "attempt_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Attempt Id"}}, {"name": "trace_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Trace Id"}}, {"name": "trace_id_contains", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Trace Id Contains"}}, {"name": "span_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Span Id"}}, {"name": "span_id_contains", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Span Id Contains"}}, {"name": "parent_id", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Parent Id"}}, {"name": "parent_id_contains", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Parent Id Contains"}}, {"name": "name", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name"}}, {"name": "name_contains", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Name Contains"}}, {"name": "filter_logic", "in": "query", "required": false, "schema": {"enum": ["and", "or"], "type": "string", "default": "and", "title": "Filter Logic"}}, {"name": "limit", "in": "query", "required": false, "schema": {"type": "integer", "default": -1, "title": "Limit"}}, {"name": "offset", "in": "query", "required": false, "schema": {"type": "integer", "default": 0, "title": "Offset"}}, {"name": "sort_by", "in": "query", "required": false, "schema": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Sort By"}}, {"name": "sort_order", "in": "query", "required": false, "schema": {"enum": ["asc", "desc"], "type": "string", "default": "asc", "title": "Sort Order"}}], "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/PaginatedResponse_Span_"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/v1/agl/spans/next": {"post": {"summary": "Get Next Span Sequence Id", "operationId": "get_next_span_sequence_id_agl_v1_spans_next_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/NextSequenceIdRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/NextSequenceIdResponse"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}, "/v1/agl/waits/rollouts": {"post": {"summary": "Wait For Rollouts", "operationId": "wait_for_rollouts_agl_v1_waits_rollouts_post", "requestBody": {"content": {"application/json": {"schema": {"$ref": "#/components/schemas/WaitForRolloutsRequest"}}}, "required": true}, "responses": {"200": {"description": "Successful Response", "content": {"application/json": {"schema": {"items": {"$ref": "#/components/schemas/Rollout"}, "type": "array", "title": "Response Wait For Rollouts Agl V1 Waits Rollouts Post"}}}}, "422": {"description": "Validation Error", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/HTTPValidationError"}}}}}}}}, "components": {"schemas": {"Attempt": {"properties": {"rollout_id": {"type": "string", "title": "Rollout Id"}, "attempt_id": {"type": "string", "title": "Attempt Id"}, "sequence_id": {"type": "integer", "title": "Sequence Id"}, "start_time": {"type": "number", "title": "Start Time"}, "end_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "End Time"}, "status": {"type": "string", "enum": ["preparing", "running", "failed", "succeeded", "unresponsive", "timeout"], "title": "Status", "default": "preparing"}, "worker_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Worker Id"}, "last_heartbeat_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Last Heartbeat Time"}, "metadata": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Metadata"}}, "type": "object", "required": ["rollout_id", "attempt_id", "sequence_id", "start_time"], "title": "Attempt", "description": "Execution attempt for a rollout, including metadata for retries."}, "AttemptedRollout": {"properties": {"rollout_id": {"type": "string", "title": "Rollout Id"}, "input": {"title": "Input"}, "start_time": {"type": "number", "title": "Start Time"}, "end_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "End Time"}, "mode": {"anyOf": [{"type": "string", "enum": ["train", "val", "test"]}, {"type": "null"}], "title": "Mode"}, "resources_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Resources Id"}, "status": {"type": "string", "enum": ["queuing", "preparing", "running", "failed", "succeeded", "cancelled", "requeuing"], "title": "Status", "default": "queuing"}, "config": {"$ref": "#/components/schemas/RolloutConfig"}, "metadata": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Metadata"}, "attempt": {"$ref": "#/components/schemas/Attempt"}}, "type": "object", "required": ["rollout_id", "input", "start_time", "attempt"], "title": "AttemptedRollout", "description": "Rollout paired with the currently active attempt."}, "Event": {"properties": {"name": {"type": "string", "title": "Name"}, "attributes": {"additionalProperties": {"anyOf": [{"type": "string"}, {"type": "boolean"}, {"type": "integer"}, {"type": "number"}, {"items": {"type": "string"}, "type": "array"}, {"items": {"type": "boolean"}, "type": "array"}, {"items": {"type": "integer"}, "type": "array"}, {"items": {"type": "number"}, "type": "array"}]}, "type": "object", "title": "Attributes"}, "timestamp": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Timestamp"}}, "additionalProperties": true, "type": "object", "required": ["name", "attributes"], "title": "Event", "description": "Serializable representation of OpenTelemetry `Event` values."}, "HTTPValidationError": {"properties": {"detail": {"items": {"$ref": "#/components/schemas/ValidationError"}, "type": "array", "title": "Detail"}}, "type": "object", "title": "HTTPValidationError"}, "LLM": {"properties": {"resource_type": {"type": "string", "const": "llm", "title": "Resource Type", "default": "llm"}, "endpoint": {"type": "string", "title": "Endpoint"}, "model": {"type": "string", "title": "Model"}, "api_key": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Api Key"}, "sampling_parameters": {"additionalProperties": true, "type": "object", "title": "Sampling Parameters"}}, "type": "object", "required": ["endpoint", "model"], "title": "LLM", "description": "Resource that identifies an LLM endpoint and its configuration."}, "Link": {"properties": {"context": {"$ref": "#/components/schemas/SpanContext"}, "attributes": {"anyOf": [{"additionalProperties": {"anyOf": [{"type": "string"}, {"type": "boolean"}, {"type": "integer"}, {"type": "number"}, {"items": {"type": "string"}, "type": "array"}, {"items": {"type": "boolean"}, "type": "array"}, {"items": {"type": "integer"}, "type": "array"}, {"items": {"type": "number"}, "type": "array"}]}, "type": "object"}, {"type": "null"}], "title": "Attributes"}}, "additionalProperties": true, "type": "object", "required": ["context"], "title": "Link", "description": "Serializable representation of OpenTelemetry `Link` values."}, "NextSequenceIdRequest": {"properties": {"rollout_id": {"type": "string", "title": "Rollout Id"}, "attempt_id": {"type": "string", "title": "Attempt Id"}}, "type": "object", "required": ["rollout_id", "attempt_id"], "title": "NextSequenceIdRequest"}, "NextSequenceIdResponse": {"properties": {"sequence_id": {"type": "integer", "title": "Sequence Id"}}, "type": "object", "required": ["sequence_id"], "title": "NextSequenceIdResponse"}, "OtelResource": {"properties": {"attributes": {"additionalProperties": {"anyOf": [{"type": "string"}, {"type": "boolean"}, {"type": "integer"}, {"type": "number"}, {"items": {"type": "string"}, "type": "array"}, {"items": {"type": "boolean"}, "type": "array"}, {"items": {"type": "integer"}, "type": "array"}, {"items": {"type": "number"}, "type": "array"}]}, "type": "object", "title": "Attributes"}, "schema_url": {"type": "string", "title": "Schema Url"}}, "type": "object", "required": ["attributes", "schema_url"], "title": "OtelResource", "description": "Serializable representation of OpenTelemetry `Resource` values.\n\nNamed as `OtelResource` to avoid confusion with the [`Resource`][agentlightning.Resource] class.\nUsers will very rarely need to construct this class directly. Most of the times,\nthey deal with the [`Resource`][agentlightning.Resource] class instead, which describes\na very different concept."}, "PaginatedResponse_Attempt_": {"properties": {"items": {"items": {"$ref": "#/components/schemas/Attempt"}, "type": "array", "title": "Items"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}, "total": {"type": "integer", "title": "Total"}}, "type": "object", "required": ["items", "limit", "offset", "total"], "title": "PaginatedResponse[Attempt]"}, "PaginatedResponse_ResourcesUpdate_": {"properties": {"items": {"items": {"$ref": "#/components/schemas/ResourcesUpdate"}, "type": "array", "title": "Items"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}, "total": {"type": "integer", "title": "Total"}}, "type": "object", "required": ["items", "limit", "offset", "total"], "title": "PaginatedResponse[ResourcesUpdate]"}, "PaginatedResponse_Rollout_": {"properties": {"items": {"items": {"$ref": "#/components/schemas/Rollout"}, "type": "array", "title": "Items"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}, "total": {"type": "integer", "title": "Total"}}, "type": "object", "required": ["items", "limit", "offset", "total"], "title": "PaginatedResponse[Rollout]"}, "PaginatedResponse_Span_": {"properties": {"items": {"items": {"$ref": "#/components/schemas/Span-Output"}, "type": "array", "title": "Items"}, "limit": {"type": "integer", "title": "Limit"}, "offset": {"type": "integer", "title": "Offset"}, "total": {"type": "integer", "title": "Total"}}, "type": "object", "required": ["items", "limit", "offset", "total"], "title": "PaginatedResponse[Span]"}, "PromptTemplate": {"properties": {"resource_type": {"type": "string", "const": "prompt_template", "title": "Resource Type", "default": "prompt_template"}, "template": {"type": "string", "title": "Template"}, "engine": {"type": "string", "enum": ["jinja", "f-string", "poml"], "title": "Engine"}}, "type": "object", "required": ["template", "engine"], "title": "PromptTemplate", "description": "Resource describing a reusable prompt template."}, "ProxyLLM": {"properties": {"resource_type": {"type": "string", "const": "proxy_llm", "title": "Resource Type", "default": "proxy_llm"}, "endpoint": {"type": "string", "title": "Endpoint"}, "model": {"type": "string", "title": "Model"}, "api_key": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Api Key"}, "sampling_parameters": {"additionalProperties": true, "type": "object", "title": "Sampling Parameters"}}, "type": "object", "required": ["endpoint", "model"], "title": "ProxyLLM", "description": "LLM resource that rewrites endpoints through [`LLMProxy`][agentlightning.LLMProxy].\n\nThe proxy injects rollout- and attempt-specific routing information into the\nendpoint so that downstream services can attribute requests correctly."}, "ResourcesUpdate": {"properties": {"resources_id": {"type": "string", "title": "Resources Id"}, "create_time": {"type": "number", "title": "Create Time"}, "update_time": {"type": "number", "title": "Update Time"}, "version": {"type": "integer", "title": "Version"}, "resources": {"additionalProperties": {"oneOf": [{"$ref": "#/components/schemas/LLM"}, {"$ref": "#/components/schemas/ProxyLLM"}, {"$ref": "#/components/schemas/PromptTemplate"}], "discriminator": {"propertyName": "resource_type", "mapping": {"llm": "#/components/schemas/LLM", "prompt_template": "#/components/schemas/PromptTemplate", "proxy_llm": "#/components/schemas/ProxyLLM"}}}, "type": "object", "title": "Resources"}}, "type": "object", "required": ["resources_id", "create_time", "update_time", "version", "resources"], "title": "ResourcesUpdate", "description": "Update payload broadcast to clients when resources change."}, "Rollout": {"properties": {"rollout_id": {"type": "string", "title": "Rollout Id"}, "input": {"title": "Input"}, "start_time": {"type": "number", "title": "Start Time"}, "end_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "End Time"}, "mode": {"anyOf": [{"type": "string", "enum": ["train", "val", "test"]}, {"type": "null"}], "title": "Mode"}, "resources_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Resources Id"}, "status": {"type": "string", "enum": ["queuing", "preparing", "running", "failed", "succeeded", "cancelled", "requeuing"], "title": "Status", "default": "queuing"}, "config": {"$ref": "#/components/schemas/RolloutConfig"}, "metadata": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Metadata"}}, "type": "object", "required": ["rollout_id", "input", "start_time"], "title": "Rollout"}, "RolloutConfig": {"properties": {"timeout_seconds": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Timeout Seconds"}, "unresponsive_seconds": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Unresponsive Seconds"}, "max_attempts": {"type": "integer", "minimum": 1.0, "title": "Max Attempts", "default": 1}, "retry_condition": {"items": {"type": "string", "enum": ["preparing", "running", "failed", "succeeded", "unresponsive", "timeout"]}, "type": "array", "title": "Retry Condition"}}, "type": "object", "title": "RolloutConfig", "description": "Configuration controlling rollout retries and timeouts."}, "RolloutRequest": {"properties": {"input": {"title": "Input"}, "mode": {"anyOf": [{"type": "string", "enum": ["train", "val", "test"]}, {"type": "null"}], "title": "Mode"}, "resources_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Resources Id"}, "config": {"anyOf": [{"$ref": "#/components/schemas/RolloutConfig"}, {"type": "null"}]}, "metadata": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Metadata"}}, "type": "object", "required": ["input"], "title": "RolloutRequest"}, "Span-Input": {"properties": {"rollout_id": {"type": "string", "title": "Rollout Id"}, "attempt_id": {"type": "string", "title": "Attempt Id"}, "sequence_id": {"type": "integer", "title": "Sequence Id"}, "trace_id": {"type": "string", "title": "Trace Id"}, "span_id": {"type": "string", "title": "Span Id"}, "parent_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Parent Id"}, "name": {"type": "string", "title": "Name"}, "status": {"$ref": "#/components/schemas/TraceStatus"}, "attributes": {"additionalProperties": {"anyOf": [{"type": "string"}, {"type": "boolean"}, {"type": "integer"}, {"type": "number"}, {"items": {"type": "string"}, "type": "array"}, {"items": {"type": "boolean"}, "type": "array"}, {"items": {"type": "integer"}, "type": "array"}, {"items": {"type": "number"}, "type": "array"}]}, "type": "object", "title": "Attributes"}, "events": {"items": {"$ref": "#/components/schemas/Event"}, "type": "array", "title": "Events"}, "links": {"items": {"$ref": "#/components/schemas/Link"}, "type": "array", "title": "Links"}, "start_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Start Time"}, "end_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "End Time"}, "context": {"anyOf": [{"$ref": "#/components/schemas/SpanContext"}, {"type": "null"}]}, "parent": {"anyOf": [{"$ref": "#/components/schemas/SpanContext"}, {"type": "null"}]}, "resource": {"$ref": "#/components/schemas/OtelResource"}}, "additionalProperties": true, "type": "object", "required": ["rollout_id", "attempt_id", "sequence_id", "trace_id", "span_id", "parent_id", "name", "status", "attributes", "events", "links", "start_time", "end_time", "context", "parent", "resource"], "title": "Span", "description": "Agent Lightning's canonical span model used for persistence and analytics.\n\nThe model captures the most relevant fields from\n`opentelemetry.sdk.trace.ReadableSpan` instances while preserving unmodeled\nattributes in Pydantic `BaseModel`'s extra storage. This keeps the serialized format\nstable even as upstream OpenTelemetry types evolve."}, "Span-Output": {"properties": {"rollout_id": {"type": "string", "title": "Rollout Id"}, "attempt_id": {"type": "string", "title": "Attempt Id"}, "sequence_id": {"type": "integer", "title": "Sequence Id"}, "trace_id": {"type": "string", "title": "Trace Id"}, "span_id": {"type": "string", "title": "Span Id"}, "parent_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Parent Id"}, "name": {"type": "string", "title": "Name"}, "status": {"$ref": "#/components/schemas/TraceStatus"}, "attributes": {"additionalProperties": {"anyOf": [{"type": "string"}, {"type": "boolean"}, {"type": "integer"}, {"type": "number"}, {"items": {"type": "string"}, "type": "array"}, {"items": {"type": "boolean"}, "type": "array"}, {"items": {"type": "integer"}, "type": "array"}, {"items": {"type": "number"}, "type": "array"}]}, "type": "object", "title": "Attributes"}, "events": {"items": {"$ref": "#/components/schemas/Event"}, "type": "array", "title": "Events"}, "links": {"items": {"$ref": "#/components/schemas/Link"}, "type": "array", "title": "Links"}, "start_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Start Time"}, "end_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "End Time"}, "context": {"anyOf": [{"$ref": "#/components/schemas/SpanContext"}, {"type": "null"}]}, "parent": {"anyOf": [{"$ref": "#/components/schemas/SpanContext"}, {"type": "null"}]}, "resource": {"$ref": "#/components/schemas/OtelResource"}}, "additionalProperties": true, "type": "object", "required": ["rollout_id", "attempt_id", "sequence_id", "trace_id", "span_id", "parent_id", "name", "status", "attributes", "events", "links", "start_time", "end_time", "context", "parent", "resource"], "title": "Span", "description": "Agent Lightning's canonical span model used for persistence and analytics.\n\nThe model captures the most relevant fields from\n`opentelemetry.sdk.trace.ReadableSpan` instances while preserving unmodeled\nattributes in Pydantic `BaseModel`'s extra storage. This keeps the serialized format\nstable even as upstream OpenTelemetry types evolve."}, "SpanContext": {"properties": {"trace_id": {"type": "string", "title": "Trace Id"}, "span_id": {"type": "string", "title": "Span Id"}, "is_remote": {"type": "boolean", "title": "Is Remote"}, "trace_state": {"additionalProperties": {"type": "string"}, "type": "object", "title": "Trace State"}}, "additionalProperties": true, "type": "object", "required": ["trace_id", "span_id", "is_remote", "trace_state"], "title": "SpanContext", "description": "Pydantic representation of `opentelemetry.trace.SpanContext` values."}, "TraceStatus": {"properties": {"status_code": {"type": "string", "title": "Status Code"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Description"}}, "additionalProperties": true, "type": "object", "required": ["status_code"], "title": "TraceStatus", "description": "Serializable variant of `opentelemetry.trace.Status`."}, "UpdateAttemptRequest": {"properties": {"status": {"anyOf": [{"type": "string", "enum": ["preparing", "running", "failed", "succeeded", "unresponsive", "timeout"]}, {"type": "null"}], "title": "Status"}, "worker_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Worker Id"}, "last_heartbeat_time": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Last Heartbeat Time"}, "metadata": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Metadata"}}, "type": "object", "title": "UpdateAttemptRequest"}, "UpdateRolloutRequest": {"properties": {"input": {"anyOf": [{}, {"type": "null"}], "title": "Input"}, "mode": {"anyOf": [{"type": "string", "enum": ["train", "val", "test"]}, {"type": "null"}], "title": "Mode"}, "resources_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "title": "Resources Id"}, "status": {"anyOf": [{"type": "string", "enum": ["queuing", "preparing", "running", "failed", "succeeded", "cancelled", "requeuing"]}, {"type": "null"}], "title": "Status"}, "config": {"anyOf": [{"$ref": "#/components/schemas/RolloutConfig"}, {"type": "null"}]}, "metadata": {"anyOf": [{"additionalProperties": true, "type": "object"}, {"type": "null"}], "title": "Metadata"}}, "type": "object", "title": "UpdateRolloutRequest"}, "ValidationError": {"properties": {"loc": {"items": {"anyOf": [{"type": "string"}, {"type": "integer"}]}, "type": "array", "title": "Location"}, "msg": {"type": "string", "title": "Message"}, "type": {"type": "string", "title": "Error Type"}}, "type": "object", "required": ["loc", "msg", "type"], "title": "ValidationError"}, "WaitForRolloutsRequest": {"properties": {"rollout_ids": {"items": {"type": "string"}, "type": "array", "title": "Rollout Ids"}, "timeout": {"anyOf": [{"type": "number"}, {"type": "null"}], "title": "Timeout"}}, "type": "object", "required": ["rollout_ids"], "title": "WaitForRolloutsRequest"}}}}
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OpenAPI specification for /v1/agl/resources endpoint is missing the newly added filter parameters resources_id and resources_id_contains. The schema only includes limit, offset, sort_by, and sort_order parameters, but the code in QueryResourcesRequest (lines 115-117 of client_server.py) defines these filter fields. The OpenAPI spec should be regenerated to include these parameters.

Copilot uses AI. Check for mistakes.
Comment on lines +338 to +344
for origin in candidates:
if not origin or not origin.strip():
continue
value = origin.strip()
if value == "*":
return ["*"]
cleaned.append(value)
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The duplicate check if not origin or not origin.strip() can be simplified to just if not origin.strip() since an empty string will fail the .strip() check anyway. This reduces redundancy and improves readability.

Copilot uses AI. Check for mistakes.
if self.app is None or not self._cors_allow_origins:
return

allow_origins = ["*"] if self._cors_allow_origins == ["*"] else self._cors_allow_origins
Copy link

Copilot AI Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This line creates a redundant copy when self._cors_allow_origins is already ['*']. The condition self._cors_allow_origins == ['*'] is true, yet we still create a new list ['*']. Consider directly using self._cors_allow_origins without the conditional, as the comparison is unnecessary.

Suggested change
allow_origins = ["*"] if self._cors_allow_origins == ["*"] else self._cors_allow_origins
allow_origins = self._cors_allow_origins
Copilot uses AI. Check for mistakes.
@ultmaster
Copy link
Contributor Author

/ci

@github-actions
Copy link

github-actions bot commented Nov 5, 2025

🚀 CI Watcher for correlation id-3489295975-mhlik4zt triggered by comment 3489295975
🏃‍♀️ Tracking 6 workflow run(s):

✅ All runs completed.

@ultmaster ultmaster merged commit 421f277 into main Nov 5, 2025
12 checks passed
totoluo pushed a commit to totoluo/agent-lightning that referenced this pull request Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants