[BUG] Progress polling does not detect terminal events on subsequent pages

未关闭
#1,273 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python, react, typescript
领域
api, frontend

调研方向

Read the progress endpoint in mod_api/routes/runs.py, the request helper in web/src/lib/api.ts, and the useRunProgress hook. Trace how pagination.next_offset and terminal events are handled, then run or extend the 51 event reproduction described in the issue. Done when polling detects completed or canceled on later pages without duplicates or unnecessary requests.

由索引模型根据 Issue 内容生成。

描述

Description

The frontend progress polling hook appears to consume only the first page of progress events returned by the backend API.

The backend paginates progress events, returning 50 events per page by default. However, the frontend does not appear to follow pagination.next_offset when retrieving progress events.

As a result, if a terminal event such as completed or canceled appears on a subsequent page, the frontend may never detect it and can continue polling indefinitely.

Steps to Reproduce
  1. Configure a run with more than 50 progress events.
  2. Ensure the terminal completed event appears after the first 50 events.
  3. Open the run details page.
  4. Observe the frontend progress polling behavior.
Expected Behavior

The frontend should consume all relevant progress pages and detect terminal events regardless of which page contains them.

Polling should stop when a terminal event (completed or canceled) is detected.

Actual Behavior

The frontend consumes only the first page of progress events.

If the terminal event appears on a subsequent page, it is not detected, and polling continues.

Investigation Details

The issue appears to involve:

  • Backend: mod_api/routes/runs.py — progress endpoint and pagination.
  • Frontend: web/src/lib/api.ts — progress API request.
  • Frontend: useRunProgress hook — polling and terminal-state detection.

An isolated reproduction using 51 events showed:

  • Terminal event within the first 50 events: detected correctly.
  • Terminal event at position 51: not detected; polling continues.

This reproduction used an isolated fixture and does not establish that a production run has encountered the issue.

Suggested Direction

Consider following pagination.next_offset when fetching progress events, ensuring that terminal events on subsequent pages are detected without introducing duplicate events or unnecessary API requests.

I would appreciate maintainer confirmation that this behavior is unintended before proceeding with an implementation.

Environment
  • Repository: CCExtractor Sample Platform
  • API: /api/v1/runs/{run_id}/progress
  • Frontend: React / TypeScript
主要语言
Python
星标
31
派生
92
平均合并
4 天 9 小时
30 天内合并 PR
29

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CCExtractor/sample-platform 的其他 Issue

查看 CCExtractor/sample-platform 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。