Tasks: API: Add pagination and granular message control to logs endpoint
まだ誰も着手していません。
評価
調査の方向性
まず、タスクログのエンドポイント、coderd の既存のページネーションパターン、codersdk.Pagination を確認します。将来の ACP メッセージ型に対応できるようにしつつ、アクティブなログと一時停止中のスナップショットでページネーションをどのように機能させるべきかを判断します。アプローチが実装および文書化され、両方の状態についてテストされ、必要に応じて CLI が更新されていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- 言語のデータがありません
- スター
- 3
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/internal のほかの issue
-
flake
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
flake
-
flake
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
microsoft/magentic-ui#588 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
alexgorbatchev/simple-ptt#3 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
CorrelAid/formtransform#44 ·