> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codecobra.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Ci Wait

> Block until CI for ``head_sha`` resolves, then return the verdict.

Called by the pod's wait_for_ci tool. Authenticated by the per-pod
proxy token (same as /api/agent/pr/create). Event-driven: subscribes to
the Redis wake channel the webhook receiver publishes to and re-queries
GitHub's rolled-up status on each wake. Fail-fast — returns the moment
any check fails, without waiting for still-pending checks.



## OpenAPI

````yaml /openapi.json post /api/agent/ci/wait
openapi: 3.1.0
info:
  description: >-
    Public CodeCobra API. Authenticate by sending a personal API key in the
    `Authorization: Bearer <key>` header. Generate keys from Settings → API keys
    in the CodeCobra dashboard.
  title: CodeCobra Public API
  version: 1.0.0
servers: []
security: []
paths:
  /api/agent/ci/wait:
    post:
      tags:
        - public
      summary: Agent Ci Wait
      description: |-
        Block until CI for ``head_sha`` resolves, then return the verdict.

        Called by the pod's wait_for_ci tool. Authenticated by the per-pod
        proxy token (same as /api/agent/pr/create). Event-driven: subscribes to
        the Redis wake channel the webhook receiver publishes to and re-queries
        GitHub's rolled-up status on each wake. Fail-fast — returns the moment
        any check fails, without waiting for still-pending checks.
      operationId: agent_ci_wait_api_agent_ci_wait_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CiWaitRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CiWaitResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    CiWaitRequest:
      properties:
        head_sha:
          title: Head Sha
          type: string
        pr_number:
          title: Pr Number
          type: integer
        repository:
          title: Repository
          type: string
      required:
        - repository
        - pr_number
        - head_sha
      title: CiWaitRequest
      type: object
    CiWaitResponse:
      properties:
        auto_fix_ci:
          default: false
          title: Auto Fix Ci
          type: boolean
        failing:
          default: []
          items:
            type: string
          title: Failing
          type: array
        head_sha:
          anyOf:
            - type: string
            - type: 'null'
          title: Head Sha
        passing:
          default: []
          items:
            type: string
          title: Passing
          type: array
        pending:
          default: []
          items:
            type: string
          title: Pending
          type: array
        status:
          enum:
            - success
            - failure
            - pending
            - no_checks
            - error
          title: Status
          type: string
        timed_out:
          default: false
          title: Timed Out
          type: boolean
        total:
          default: 0
          title: Total
          type: integer
      required:
        - status
      title: CiWaitResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object

````