Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Tasks: API: Add pagination and granular message control to logs endpoint

Đang mở
#1,247 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Lĩnh vực
api, backend

Hướng nghiên cứu

Bắt đầu bằng cách xem xét endpoint nhật ký tác vụ, các mẫu phân trang hiện có của coderd và codersdk.Pagination. Xác định cách phân trang cần hoạt động đối với nhật ký đang hoạt động và các snapshot bị tạm dừng, đồng thời cho phép các loại thông báo ACP trong tương lai. Công việc được xem là hoàn tất khi phương án đã được triển khai, ghi lại tài liệu, được kiểm thử cho cả hai trạng thái và CLI được cập nhật nếu cần.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

The task logs API (GET /api/v2/tasks/{user}/{task}/logs) currently returns the entire conversation history. This is not ideal for tasks with long-running conversations:

  • Large response payloads for tasks with hundreds of messages
  • No way to fetch specific message ranges
  • Inefficient for clients that only need recent messages or want to implement infinite scroll

Current Behavior

The API returns all messages in a single response:

{
  "logs": [...],  // All messages
  "snapshot": false,
  "total_count": 250
}

When a task is paused (post-implementation of pause/resume functionality), it returns the last 10 messages from the snapshot:

{
  "logs": [...],  // Last 10 messages
  "snapshot": true,
  "snapshot_at": "2025-01-18T10:00:00Z",
  "total_count": 10
}

Proposed Enhancement

Add pagination support to the logs endpoint. The exact implementation will depend on the message model after ACP integration, which may introduce more granular message types, status updates, and metadata beyond the current large text blocks.

Pagination should follow coderd's existing patterns (using limit, offset, and after_id query parameters as defined in codersdk.Pagination).

Key considerations:

  • With ACP, messages may be split into multiple granular events rather than 500-line text blocks
  • The message structure and metadata may evolve significantly
  • Pagination design should accommodate future message model changes

Context

Raised during RFC review for Task Start/Pause/Resume Lifecycle. Deferred from Beta/GA as it's an enhancement rather than blocking issue.

Acceptance Criteria

  • Design pagination approach that accommodates future ACP message model changes
  • Works for both active tasks (live logs) and paused tasks (snapshots)
  • Follows coderd's existing pagination patterns
  • Document pagination behavior
  • Update CLI if needed to support fetching message ranges

Related

  • RFC: Task Start/Pause/Resume Lifecycle
  • Future: ACP integration for message-level control
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
3
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của coder/internal

Tất cả issue của coder/internal

Issue tương tự

Thêm issue về Backend & API Design

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.