> This page is also available as Markdown: append .md to its URL. The full index of Sikaru docs is at https://docs.sikaru.ai/llms.txt. Code examples use only operations from the public API reference at https://docs.sikaru.ai/api-reference.

# compute_channel

GET /v1/projects/{project_id}/compute-attachments/{attachment_id}/channel

Upgrade with the restricted executor credential in the Authorization header only; the route accepts no query parameters. The upgrade is refused with the HTTP route status (401, 403, 409) when the credential, its owner epoch or the environment is not current. Use the channel only while the handshake and work page advertise transport 'channel'.

Reference: https://docs.sikaru.ai/api-reference/compute-channel/v-1-projects-project-id-compute-attachments-attachment-id-channel

## AsyncAPI Specification

```yaml
asyncapi: 2.6.0
info:
  title: compute_channel
  version: >-
    subpackage_computeChannel.v1ProjectsProjectIdComputeAttachmentsAttachmentIdChannel
  description: >-
    Upgrade with the restricted executor credential in the Authorization header
    only; the route accepts no query parameters. The upgrade is refused with the
    HTTP route status (401, 403, 409) when the credential, its owner epoch or
    the environment is not current. Use the channel only while the handshake and
    work page advertise transport 'channel'.
channels:
  /v1/projects/{project_id}/compute-attachments/{attachment_id}/channel:
    description: >-
      Upgrade with the restricted executor credential in the Authorization
      header only; the route accepts no query parameters. The upgrade is refused
      with the HTTP route status (401, 403, 409) when the credential, its owner
      epoch or the environment is not current. Use the channel only while the
      handshake and work page advertise transport 'channel'.
    parameters:
      attachment_id:
        schema:
          type: string
      project_id:
        schema:
          type: string
    publish:
      operationId: >-
        subpackage_computeChannel.v1ProjectsProjectIdComputeAttachmentsAttachmentIdChannel-publish
      summary: subscribe
      message:
        name: subscribe
        title: subscribe
        payload:
          $ref: >-
            #/components/schemas/V1ProjectsProjectIdComputeAttachmentsAttachmentIdChannelSubscribe
    subscribe:
      operationId: >-
        subpackage_computeChannel.v1ProjectsProjectIdComputeAttachmentsAttachmentIdChannel-subscribe
      summary: publish
      message:
        name: publish
        title: publish
        payload:
          $ref: >-
            #/components/schemas/V1ProjectsProjectIdComputeAttachmentsAttachmentIdChannelPublish
servers:
  https://api.sikaru.ai:
    url: wss://api.sikaru.ai/
    protocol: wss
    x-default: true
components:
  schemas:
    CloseFrameReason:
      type: string
      enum:
        - transport_poll
        - credential_invalid
        - environment_disabled
        - stale_owner
        - workspace_generation_changed
        - attachment_stopped
        - heartbeat_timeout
        - rate_limited
        - frame_too_large
        - invalid_frame
      title: CloseFrameReason
    HandshakeFrameTransport:
      type: string
      enum:
        - channel
        - poll
      title: HandshakeFrameTransport
    AttachmentViewCleanupStatus:
      type: string
      enum:
        - unconfirmed
        - confirmed
      title: AttachmentViewCleanupStatus
    ProcessObservationStatus:
      type: string
      enum:
        - running
        - exited
        - cancelled
        - lost
      title: ProcessObservationStatus
    ProcessObservation:
      type: object
      properties:
        evidence:
          type: string
          minLength: 1
          maxLength: 3096
        handle_id:
          type: string
          minLength: 1
          maxLength: 128
        status:
          $ref: '#/components/schemas/ProcessObservationStatus'
      required:
        - evidence
        - handle_id
        - status
      title: ProcessObservation
    AttachmentViewStatus:
      type: string
      enum:
        - pending
        - starting
        - ready
        - stopping
        - cleaned
        - startup_expired
        - recovery_required
        - abandoned
      title: AttachmentViewStatus
    UncertainOperation:
      type: object
      properties:
        method:
          type: string
        owner_epoch:
          type: integer
        request_digest:
          type: string
        run_id:
          type: string
        tool_call_id:
          type: string
        workspace_generation:
          type: string
      required:
        - method
        - owner_epoch
        - request_digest
        - run_id
        - tool_call_id
        - workspace_generation
      title: UncertainOperation
    WorkspaceProvenanceKind:
      type: string
      enum:
        - existing_directory
        - container
        - sandbox
      title: WorkspaceProvenanceKind
    WorkspaceProvenance:
      type: object
      properties:
        identity:
          type: string
          minLength: 1
          maxLength: 128
        kind:
          $ref: '#/components/schemas/WorkspaceProvenanceKind'
      required:
        - identity
        - kind
      title: WorkspaceProvenance
    AttachmentView:
      type: object
      properties:
        capabilities:
          type: array
          items:
            type: string
        cleanup_at:
          type:
            - number
            - 'null'
          format: double
        cleanup_status:
          $ref: '#/components/schemas/AttachmentViewCleanupStatus'
        environment_id:
          type: string
        id:
          type: string
        journal_id:
          type: string
        lease_ttl_seconds:
          type: integer
          default: 60
          description: >-
            Renewal TTL; anchor only ready/heartbeat acknowledgments to
            request-start monotonic time. Status and poll responses never renew
            the lease.
        lease_until:
          type: number
          format: double
        owner_epoch:
          type: integer
        owner_id:
          type:
            - string
            - 'null'
        processes:
          type: array
          items:
            $ref: '#/components/schemas/ProcessObservation'
        project_id:
          type: string
        protocol_version:
          type:
            - string
            - 'null'
        provider_id:
          type: string
        session_id:
          type: string
        startup_deadline:
          type: number
          format: double
        status:
          $ref: '#/components/schemas/AttachmentViewStatus'
        uncertain_operations:
          type: array
          items:
            $ref: '#/components/schemas/UncertainOperation'
        workspace_generation:
          type: string
        workspace_provenance:
          $ref: '#/components/schemas/WorkspaceProvenance'
      required:
        - capabilities
        - cleanup_at
        - cleanup_status
        - environment_id
        - id
        - journal_id
        - lease_until
        - owner_epoch
        - owner_id
        - processes
        - project_id
        - protocol_version
        - provider_id
        - session_id
        - startup_deadline
        - status
        - uncertain_operations
        - workspace_generation
        - workspace_provenance
      title: AttachmentView
    ExecutionView:
      type: object
      properties:
        approval_required:
          type: boolean
        run_id:
          type: string
        status:
          type: string
        terminal:
          type: boolean
      required:
        - approval_required
        - run_id
        - status
        - terminal
      title: ExecutionView
    WorkPageExecutionPhase:
      type: string
      enum:
        - idle
        - running
        - waiting_approval
        - terminal
      title: WorkPageExecutionPhase
    LiveHandle:
      type: object
      properties:
        handle_id:
          type: string
        run_id:
          type: string
        tool_call_id:
          type: string
      required:
        - handle_id
        - run_id
        - tool_call_id
      title: LiveHandle
    OperationViewMethod:
      type: string
      enum:
        - bash.run
        - bash.start
        - bash.read
        - bash.wait
        - bash.cancel
        - workspace.write_text
        - bash.wait_for
        - jobs.next_completed
      title: OperationViewMethod
    OperationView:
      type: object
      properties:
        arguments:
          type: object
          additionalProperties:
            description: Any type
        capability_name:
          type: string
          enum:
            - compute.execute
        method:
          $ref: '#/components/schemas/OperationViewMethod'
        owner_epoch:
          type: integer
        request_digest:
          type: string
        run_id:
          type: string
        tool_call_id:
          type: string
        tool_provider_id:
          type: string
        workspace_generation:
          type: string
      required:
        - arguments
        - capability_name
        - method
        - owner_epoch
        - request_digest
        - run_id
        - tool_call_id
        - tool_provider_id
        - workspace_generation
      title: OperationView
    WorkPageTransport:
      type: string
      enum:
        - channel
        - poll
      default: poll
      description: >-
        Transport the current blocking turn's harness selects for this
        attachment. Use the executor channel only while this is 'channel';
        otherwise poll this route.
      title: WorkPageTransport
    WorkPage:
      type: object
      properties:
        attachment:
          $ref: '#/components/schemas/AttachmentView'
        execution:
          oneOf:
            - $ref: '#/components/schemas/ExecutionView'
            - type: 'null'
        execution_phase:
          $ref: '#/components/schemas/WorkPageExecutionPhase'
        issued_operations:
          type: array
          items:
            $ref: '#/components/schemas/UncertainOperation'
        live_handles:
          type: array
          items:
            $ref: '#/components/schemas/LiveHandle'
        operations:
          type: array
          items:
            $ref: '#/components/schemas/OperationView'
        poll_after_seconds:
          type: integer
          default: 1
        transport:
          $ref: '#/components/schemas/WorkPageTransport'
          default: poll
          description: >-
            Transport the current blocking turn's harness selects for this
            attachment. Use the executor channel only while this is 'channel';
            otherwise poll this route.
      required:
        - attachment
        - execution
        - execution_phase
        - issued_operations
        - live_handles
        - operations
      title: WorkPage
    ReceiptView:
      type: object
      properties:
        created:
          type: boolean
        status:
          type: string
          enum:
            - accepted
          default: accepted
        tool_call_id:
          type: string
      required:
        - created
        - tool_call_id
      title: ReceiptView
    ReceiptRejectedFrameStatus:
      type: string
      enum:
        - '404'
        - '409'
        - '422'
      title: ReceiptRejectedFrameStatus
    V1ProjectsProjectIdComputeAttachmentsAttachmentIdChannelSubscribe:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - close
              description: 'Discriminator value: close'
            detail:
              type: string
            reason:
              $ref: '#/components/schemas/CloseFrameReason'
          required:
            - type
            - detail
            - reason
          description: >-
            Last server frame before the WebSocket close; each reason has a
            fixed close code.


            After any close, reconcile over HTTP, then reconnect with jittered
            backoff or

            poll the work route.


            WebSocket close codes by reason: `attachment_stopped` 4410,
            `credential_invalid` 4401, `environment_disabled` 4403,
            `frame_too_large` 1009, `heartbeat_timeout` 4408, `invalid_frame`
            1008, `rate_limited` 4429, `stale_owner` 4409, `transport_poll`
            1000, `workspace_generation_changed` 4412. A gateway shutdown closes
            with 1012 and no close frame.
        - type: object
          properties:
            type:
              type: string
              enum:
                - handshake
              description: 'Discriminator value: handshake'
            attachment_id:
              type: string
            heartbeat_interval_seconds:
              type: number
              format: double
            heartbeat_timeout_seconds:
              type: number
              format: double
            inbound_frame_limit:
              type: integer
            inbound_frame_window_seconds:
              type: number
              format: double
            max_frame_bytes:
              type: integer
            owner_epoch:
              type: integer
            protocol:
              type: string
              enum:
                - sikaru-compute-channel-v1
              default: sikaru-compute-channel-v1
            transport:
              $ref: '#/components/schemas/HandshakeFrameTransport'
            workspace_generation:
              type: string
          required:
            - type
            - attachment_id
            - heartbeat_interval_seconds
            - heartbeat_timeout_seconds
            - inbound_frame_limit
            - inbound_frame_window_seconds
            - max_frame_bytes
            - owner_epoch
            - transport
            - workspace_generation
          description: >-
            First server frame. ``transport`` is resolved per attachment from
            its blocking turn.
        - type: object
          properties:
            type:
              type: string
              enum:
                - heartbeat
              description: 'Discriminator value: heartbeat'
          required:
            - type
          description: >-
            Sent by both sides every ``heartbeat_interval_seconds``; any inbound
            frame counts as liveness.


            Heartbeats keep the connection alive only; the attachment lease is
            renewed over HTTP.
        - type: object
          properties:
            type:
              type: string
              enum:
                - operations
              description: 'Discriminator value: operations'
            page:
              $ref: '#/components/schemas/WorkPage'
          required:
            - type
            - page
          description: >-
            The attachment work page, as the HTTP work route returns it.


            Sent on connect and whenever it changes. Every connection re-sends
            each

            operation until its receipt is recorded, with the same
            ``run_id``/``tool_call_id``

            and ``request_digest``; the executor journal launches each identity
            at most once.
        - type: object
          properties:
            type:
              type: string
              enum:
                - receipt_accepted
              description: 'Discriminator value: receipt_accepted'
            receipt:
              $ref: '#/components/schemas/ReceiptView'
            run_id:
              type: string
          required:
            - type
            - receipt
            - run_id
          description: ReceiptAcceptedFrame variant
        - type: object
          properties:
            type:
              type: string
              enum:
                - receipt_rejected
              description: 'Discriminator value: receipt_rejected'
            detail:
              type: string
            run_id:
              type:
                - string
                - 'null'
              default: null
            status:
              $ref: '#/components/schemas/ReceiptRejectedFrameStatus'
            tool_call_id:
              type:
                - string
                - 'null'
              default: null
          required:
            - type
            - detail
            - status
          description: >-
            A receipt the HTTP route would reject, with the same status code.
            The channel stays open.
      discriminator:
        propertyName: type
      description: A server-to-executor frame, selected by its `type`.
      title: V1ProjectsProjectIdComputeAttachmentsAttachmentIdChannelSubscribe
    ReceiptInputStatus:
      type: string
      enum:
        - completed
        - failed
      title: ReceiptInputStatus
    ReceiptInput:
      type: object
      properties:
        capability_name:
          type: string
          enum:
            - compute.execute
          default: compute.execute
        idempotency_key:
          type: string
          minLength: 1
          maxLength: 128
        payload:
          type: object
          additionalProperties:
            description: Any type
        request_digest:
          type: string
          pattern: ^[a-f0-9]{64}$
        run_id:
          type: string
          minLength: 1
          maxLength: 128
        status:
          $ref: '#/components/schemas/ReceiptInputStatus'
        tool_call_id:
          type: string
          minLength: 1
          maxLength: 128
        tool_provider_id:
          type: string
          minLength: 1
          maxLength: 128
      required:
        - idempotency_key
        - payload
        - request_digest
        - run_id
        - status
        - tool_call_id
        - tool_provider_id
      title: ReceiptInput
    V1ProjectsProjectIdComputeAttachmentsAttachmentIdChannelPublish:
      oneOf:
        - type: object
          properties:
            type:
              type: string
              enum:
                - heartbeat
              description: 'Discriminator value: heartbeat'
          required:
            - type
          description: >-
            Sent by both sides every ``heartbeat_interval_seconds``; any inbound
            frame counts as liveness.


            Heartbeats keep the connection alive only; the attachment lease is
            renewed over HTTP.
        - type: object
          properties:
            type:
              type: string
              enum:
                - receipt
              description: 'Discriminator value: receipt'
            receipt:
              $ref: '#/components/schemas/ReceiptInput'
          required:
            - type
            - receipt
          description: >-
            Executor receipt; admitted exactly as the HTTP receipt route admits
            its body.
      discriminator:
        propertyName: type
      description: An executor-to-server frame, selected by its `type`.
      title: V1ProjectsProjectIdComputeAttachmentsAttachmentIdChannelPublish

```