Skip to content

Commit 45ff7f7

Browse files
author
sam
committed
feat(agents-api): expose runtime observations
1 parent 2a0715f commit 45ff7f7

22 files changed

Lines changed: 1674 additions & 112 deletions

‎contracts/agents-api/README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@ paths start at `/vaults`, not `/agents/vaults`.
9898
| vaults | create, retrieve, list, delete | Create/retrieve/list/delete with independent tenant persistence, stored status filtering, atomic Credential cascade and frozen Session attachments; archive semantics and full hosted lifecycle parity remain missing |
9999
| vaults.credentials | create, retrieve, update, list, delete | Static-bearer create/retrieve/list/token replacement/deletion with scoped encrypted storage; Session attachment and exact-URL HTTPS MCP binding; OAuth, archive semantics and full hosted lifecycle parity remain missing |
100100

101+
## Core extension inventory
102+
103+
The operations below are implemented public Core extensions. They are excluded
104+
from the 42-operation upstream inventory and must not be counted as OpenAI Agents
105+
compatibility.
106+
107+
| Extension | Operations | Current coverage |
108+
| --- | --- | --- |
109+
| Runtime observations | `GET /v1/agents/runtime-observations`; `GET /v1/agents/sessions/{session_id}/runtime-observation` | Current, read-only, tenant-scoped Session contexts with stable Session-keyset pagination, bounded concurrent sampling, Docker metrics, explicit unsupported/unavailable states, strict `packages/agents-client` projection, and no lifecycle mutation. Kubernetes, E2B, self-hosted telemetry, history, CPU-rate derivation, and automatic idle policy remain unimplemented. See [Runtime observation API](runtime-observability-api.md). |
110+
101111
For each resource, verify the referenced request/response unions and observable
102112
behavior, not just the route. Non-text initial input, configuration
103113
options, text/image content, function results, environment variants, full Item/SSE

‎contracts/agents-api/openapi.yaml‎

Lines changed: 283 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,180 @@ definitions:
868868
required:
869869
- type
870870
type: object
871+
v1.RuntimeCPUObservation:
872+
properties:
873+
capacity_cores:
874+
minimum: 5e-324
875+
type: number
876+
x-nullable: true
877+
usage_cores:
878+
minimum: 0
879+
type: number
880+
x-nullable: true
881+
usage_seconds_total:
882+
minimum: 0
883+
type: number
884+
x-nullable: true
885+
utilization_ratio:
886+
minimum: 0
887+
type: number
888+
x-nullable: true
889+
required:
890+
- capacity_cores
891+
- usage_cores
892+
- usage_seconds_total
893+
- utilization_ratio
894+
type: object
895+
v1.RuntimeInstance:
896+
properties:
897+
allocation_id:
898+
format: uuid
899+
type: string
900+
x-nullable: true
901+
connection_generation:
902+
format: uuid
903+
type: string
904+
x-nullable: true
905+
device_id:
906+
format: uuid
907+
type: string
908+
x-nullable: true
909+
kind:
910+
enum:
911+
- managed_allocation
912+
- self_hosted_connection
913+
- none
914+
type: string
915+
required:
916+
- allocation_id
917+
- connection_generation
918+
- device_id
919+
- kind
920+
type: object
921+
v1.RuntimeMemoryObservation:
922+
properties:
923+
limit_bytes:
924+
minimum: 1
925+
type: integer
926+
x-nullable: true
927+
usage_bytes:
928+
minimum: 0
929+
type: integer
930+
x-nullable: true
931+
required:
932+
- limit_bytes
933+
- usage_bytes
934+
type: object
935+
v1.RuntimeObservation:
936+
properties:
937+
allocation_created_at:
938+
minimum: 0
939+
type: integer
940+
x-nullable: true
941+
cpu:
942+
allOf:
943+
- $ref: '#/definitions/v1.RuntimeCPUObservation'
944+
x-nullable: true
945+
environment_id:
946+
format: uuid
947+
type: string
948+
x-nullable: true
949+
id:
950+
format: uuid
951+
type: string
952+
instance:
953+
$ref: '#/definitions/v1.RuntimeInstance'
954+
memory:
955+
allOf:
956+
- $ref: '#/definitions/v1.RuntimeMemoryObservation'
957+
x-nullable: true
958+
mode:
959+
enum:
960+
- none
961+
- self_hosted
962+
- openai_hosted
963+
type: string
964+
object:
965+
enum:
966+
- agent.runtime_observation
967+
type: string
968+
observed_at:
969+
minimum: 0
970+
type: integer
971+
x-nullable: true
972+
provider_type:
973+
type: string
974+
x-nullable: true
975+
reason:
976+
enum:
977+
- runtime_mode_not_observable
978+
- allocation_pending
979+
- runtime_not_running
980+
- source_not_configured
981+
- sample_timeout
982+
- sample_unavailable
983+
type: string
984+
x-nullable: true
985+
resolved_at:
986+
minimum: 0
987+
type: integer
988+
session_id:
989+
format: uuid
990+
type: string
991+
started_at:
992+
minimum: 0
993+
type: integer
994+
x-nullable: true
995+
status:
996+
enum:
997+
- observed
998+
- unsupported
999+
- unavailable
1000+
type: string
1001+
required:
1002+
- allocation_created_at
1003+
- cpu
1004+
- environment_id
1005+
- id
1006+
- instance
1007+
- memory
1008+
- mode
1009+
- object
1010+
- observed_at
1011+
- provider_type
1012+
- reason
1013+
- resolved_at
1014+
- session_id
1015+
- started_at
1016+
- status
1017+
type: object
1018+
v1.RuntimeObservationList:
1019+
properties:
1020+
data:
1021+
items:
1022+
$ref: '#/definitions/v1.RuntimeObservation'
1023+
type: array
1024+
first_id:
1025+
format: uuid
1026+
type: string
1027+
x-nullable: true
1028+
has_more:
1029+
type: boolean
1030+
last_id:
1031+
format: uuid
1032+
type: string
1033+
x-nullable: true
1034+
object:
1035+
enum:
1036+
- list
1037+
type: string
1038+
required:
1039+
- data
1040+
- first_id
1041+
- has_more
1042+
- last_id
1043+
- object
1044+
type: object
8711045
v1.SavedAgent:
8721046
properties:
8731047
created_at:
@@ -2581,6 +2755,68 @@ paths:
25812755
summary: Update an Environment Template
25822756
tags:
25832757
- Environment Templates
2758+
/agents/runtime-observations:
2759+
get:
2760+
description: Core extension listing one current Runtime context per tenant-owned
2761+
Session in Session creation order. Each row has an independent resolved_at
2762+
and optional provider observed_at; the page is not an atomic telemetry snapshot.
2763+
parameters:
2764+
- description: agents=v1
2765+
in: header
2766+
name: OpenAI-Beta
2767+
required: true
2768+
type: string
2769+
- description: Last observation ID from the previous page
2770+
in: query
2771+
name: after
2772+
type: string
2773+
- default: 20
2774+
description: Page size
2775+
in: query
2776+
maximum: 100
2777+
minimum: 1
2778+
name: limit
2779+
type: integer
2780+
- default: desc
2781+
description: Session creation order
2782+
enum:
2783+
- asc
2784+
- desc
2785+
in: query
2786+
name: order
2787+
type: string
2788+
produces:
2789+
- application/json
2790+
responses:
2791+
"200":
2792+
description: OK
2793+
schema:
2794+
$ref: '#/definitions/v1.RuntimeObservationList'
2795+
"400":
2796+
description: Bad Request
2797+
schema:
2798+
$ref: '#/definitions/v1.ErrorResponse'
2799+
"401":
2800+
description: Unauthorized
2801+
schema:
2802+
$ref: '#/definitions/v1.ErrorResponse'
2803+
"404":
2804+
description: Not Found
2805+
schema:
2806+
$ref: '#/definitions/v1.ErrorResponse'
2807+
"500":
2808+
description: Internal Server Error
2809+
schema:
2810+
$ref: '#/definitions/v1.ErrorResponse'
2811+
"503":
2812+
description: Service Unavailable
2813+
schema:
2814+
$ref: '#/definitions/v1.ErrorResponse'
2815+
security:
2816+
- BearerAuth: []
2817+
summary: List current Runtime observations
2818+
tags:
2819+
- Runtime observations
25842820
/agents/sessions:
25852821
get:
25862822
description: Cursor and results are scoped to the authenticated execution tenant.
@@ -3348,6 +3584,53 @@ paths:
33483584
summary: List persisted execution Items
33493585
tags:
33503586
- Items
3587+
/agents/sessions/{session_id}/runtime-observation:
3588+
get:
3589+
description: Core extension returning one tenant-scoped, read-only current Runtime
3590+
observation. It never provisions, renews, restarts, pauses or stops compute.
3591+
parameters:
3592+
- description: agents=v1
3593+
in: header
3594+
name: OpenAI-Beta
3595+
required: true
3596+
type: string
3597+
- description: Session ID
3598+
in: path
3599+
name: session_id
3600+
required: true
3601+
type: string
3602+
produces:
3603+
- application/json
3604+
responses:
3605+
"200":
3606+
description: OK
3607+
schema:
3608+
$ref: '#/definitions/v1.RuntimeObservation'
3609+
"400":
3610+
description: Bad Request
3611+
schema:
3612+
$ref: '#/definitions/v1.ErrorResponse'
3613+
"401":
3614+
description: Unauthorized
3615+
schema:
3616+
$ref: '#/definitions/v1.ErrorResponse'
3617+
"404":
3618+
description: Not Found
3619+
schema:
3620+
$ref: '#/definitions/v1.ErrorResponse'
3621+
"500":
3622+
description: Internal Server Error
3623+
schema:
3624+
$ref: '#/definitions/v1.ErrorResponse'
3625+
"503":
3626+
description: Service Unavailable
3627+
schema:
3628+
$ref: '#/definitions/v1.ErrorResponse'
3629+
security:
3630+
- BearerAuth: []
3631+
summary: Retrieve a Session Runtime observation
3632+
tags:
3633+
- Runtime observations
33513634
/agents/sessions/{session_id}/subagents:
33523635
get:
33533636
description: Includes nested and closed Subagents. Cursors belong to the same

0 commit comments

Comments
 (0)