Skip to content

Conversation

chethanuk
Copy link

Introduces a new FastAPI-based API package (trae_api) with agent execution, streaming, health/metrics, echo, and task endpoints; comprehensive logging, metrics, middleware, tracing, config, and lifecycle scaffolding; TaskIQ broker, tasks, and SQLite result backend; extensive tests; new schemas in trae_agent; minor agent tweaks; Makefile updates; README additions.

New Features

Introduced a REST API with agent execution (sync/stream), health, metrics, readiness/liveness, echo, and background task endpoints.

Agent Execution Endpoints:

  • POST /api/agent/run - Synchronous agent execution
  • POST /api/agent/run/stream - Real-time streaming (SSE/NDJSON)
  • GET /api/agent/executions/{id}/status - Execution status tracking
  • GET /api/agent/executions - List active executions

Added real-time streaming (SSE/NDJSON), structured logging, observability, and Prometheus-compatible metrics.
Provided local task queue with SQLite result backend and an application entrypoint to run the server.

  • Documentation: Added API Usage guidance with start instructions, base URL, examples, and endpoint list.

  • Chores: Expanded Makefile with install/run/test/format/type-check commands for the API and Updated ignore rules.

  • Tests: Added comprehensive unit, integration, and end-to-end tests across API, logging, metrics, tasks, and SQLite.

Validation

Start API:
Screenshot 2025-08-18 at 1 28 22 AM

API Tests:
Screenshot 2025-08-18 at 1 26 10 AM

API Endpoints:
Screenshot 2025-08-18 at 1 28 57 AM

OpenAPI Spec:
Screenshot 2025-08-18 at 1 30 23 AM

Linked Issues

Closes: #250

If this PR fully resolves the issue, use one of the following keywords to automatically close the issue when this PR is merged:

Introduces a new FastAPI-based API package (trae_api) with agent execution, streaming, health/metrics, echo, and task endpoints; comprehensive logging, metrics, middleware, tracing, config, and lifecycle scaffolding; TaskIQ broker, tasks, and SQLite result backend; extensive tests; new schemas in trae_agent; minor agent tweaks; Makefile updates; README additions.

    New Features
        Introduced a REST API with agent execution (sync/stream), health, metrics, readiness/liveness, echo, and background task endpoints.
        
        Agent Execution Endpoints:

        - POST /api/agent/run - Synchronous agent execution
        - POST /api/agent/run/stream - Real-time streaming (SSE/NDJSON)
        - GET /api/agent/executions/{id}/status - Execution status tracking
        - GET /api/agent/executions - List active executions

        Added real-time streaming (SSE/NDJSON), structured logging, observability, and Prometheus-compatible metrics.
        Provided local task queue with SQLite result backend and an application entrypoint to run the server.

    Documentation
        Added API Usage guidance with start instructions, base URL, examples, and endpoint list.

    Chores
        Expanded Makefile with install/run/test/format/type-check commands for the API.
        Updated ignore rules.

    Bug Fixes
        Prevented writes to invalid patch paths.

    Tests
        Added comprehensive unit, integration, and end-to-end tests across API, logging, metrics, tasks, and SQLite.
@CLAassistant
Copy link

CLAassistant commented Aug 17, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HTTP-Server: Hosting Trae Agent as a HTTP server
2 participants