Tasks: API: Add pagination and granular message control to logs endpoint
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
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của coder/internal
-
flake
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
-
flake
-
flake
Tất cả issue của coder/internal
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
mksglu/context-mode#1200 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:auth-provider issue-rating: 🌊 off-meta tidepool P2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100