Agent Sessions
Stream console logs for a hosted agent session
Streams console logs (stdout / stderr) for a specific hosted agent session as a Server-Sent Events (SSE) stream.
Each SSE frame contains:
event: always"log"data: a plain-text log line (currently JSON-formatted, but the schema is not contractual and may include additional keys or change format over time — clients should treat it as an opaque string)
Example SSE frames:
event: log
data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port 8088"}
event: log
data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."}
event: log
data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"}
event: log
data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"}
The stream remains open until the client disconnects or the server terminates the connection. Clients should handle reconnection as needed.
Параметры пути
agent_name
string
обязательно
The name of the hosted agent.
agent_version
string
обязательно
The version of the agent.
session_id
string
обязательно
The session ID (maps to an ADC sandbox).
Параметры запроса
api-version
string
обязательно
The API version to use for this operation.
Ответы
The request has succeeded.
Текст
event
string | enum
обязательно
Known SSE event types emitted by the hosted agent session log stream. Additional event types may be introduced in future versions.
enum
data
string
обязательно
The event payload as plain text. Currently JSON-formatted but the schema is not contractual and may change.
Запрос
GET /agents/{agent_name}/versions/{agent_version}/sessions/{session_id}:logstream HTTP/1.1
Response
Status: 200
Content-Type: text/event-stream
Status: 4XX
Content-Type: application/json
Status: 5XX
Content-Type: application/json