> ## 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.

# Check Ci

> Fetch GitHub CI status for every open PR on the task.

Previously this fired a synthetic agent turn that asked the model to
run `gh pr checks` and narrate the result. That cost an LLM round
trip and a chat message for what is a pure data lookup — and worse,
the model would sometimes hallucinate the verdict. Now the backend
queries GitHub directly via ``github_service.get_pr_check_status``
and returns a flat per-PR list. The frontend renders the verdict on
each row's button (passing / failing / pending) and only escalates
to the agent — via /fix-ci below — when the user clicks the failing
button to ask for a fix.



## OpenAPI

````yaml /openapi.json post /api/tasks/{task_id}/check-ci
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/tasks/{task_id}/check-ci:
    post:
      tags:
        - public
      summary: Check Ci
      description: |-
        Fetch GitHub CI status for every open PR on the task.

        Previously this fired a synthetic agent turn that asked the model to
        run `gh pr checks` and narrate the result. That cost an LLM round
        trip and a chat message for what is a pure data lookup — and worse,
        the model would sometimes hallucinate the verdict. Now the backend
        queries GitHub directly via ``github_service.get_pr_check_status``
        and returns a flat per-PR list. The frontend renders the verdict on
        each row's button (passing / failing / pending) and only escalates
        to the agent — via /fix-ci below — when the user clicks the failing
        button to ask for a fix.
      operationId: check_ci_api_tasks__task_id__check_ci_post
      parameters:
        - in: path
          name: task_id
          required: true
          schema:
            format: uuid
            title: Task Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckCiResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    CheckCiResponse:
      properties:
        results:
          items:
            $ref: '#/components/schemas/CheckCiResult'
          title: Results
          type: array
      required:
        - results
      title: CheckCiResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    CheckCiResult:
      description: Per-PR CI verdict for the activity-strip "Check CI" button.
      properties:
        failing:
          default: []
          items:
            type: string
          title: Failing
          type: array
        fix_when_ready:
          default: false
          title: Fix When Ready
          type: boolean
        no_progress_runs:
          default: 0
          title: No Progress Runs
          type: integer
        passing:
          default: []
          items:
            type: string
          title: Passing
          type: array
        pending:
          default: []
          items:
            type: string
          title: Pending
          type: array
        pr_id:
          format: uuid
          title: Pr Id
          type: string
        pr_number:
          title: Pr Number
          type: integer
        repository:
          title: Repository
          type: string
        status:
          enum:
            - success
            - failure
            - pending
            - no_checks
            - error
          title: Status
          type: string
        total:
          default: 0
          title: Total
          type: integer
      required:
        - pr_id
        - pr_number
        - repository
        - status
      title: CheckCiResult
      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
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http

````