teai stalled 未同步 gitea.py 停滯判定修補(agents #34/#38/#40):漏列項目、last_activity_at 偏晚 #34

Closed
opened 2026-09-11 11:23:42 +08:00 by queena · 3 comments
Member

現象

交叉驗證(#9,2026-09-11 實測)發現 teai stalled 與最新 gitea.py stalled(agents @ 78769ec)分歧:

  1. 漏列 teai#26:gitea.py 列出 #26(assignee-idle,stalled_hours≈16.5),teai 未列出。
  2. 多筆 last_activity_at 偏晚:如 alterminal/teai #9 的子項 #27 活動,teai 記 2026-09-10T22:49:12+08:00、gitea.py 記 2026-09-09T21:46:45+08:00(被引用事件刷新)。

根因(已定位)

agents 倉庫近期三個修補未同步到 Go 端 internal/workflow/workflow.go:

  • agents #34(PR #35):排除 comment_ref/issue_ref 引用事件。
  • agents #38(PR #39,e5150f3):_child_activity 對子項最後活動以 _direct_last_activity 核對後採計(排除跨 issue 引用傳播)。
  • agents #40(PR #41,5bad18c):timeline 全為引用事件時回退已知直接活動的最晚時刻。

實證:teai stalled 與修補前的 gitea.py(agents @ b5af39f)輸出位元組一致——分歧正是這三個修補造成,Go 端停留在舊判定。

Go 端現況:workflow.go 的子項活動直接取 child.UpdatedAt/child.ClosedAt/留言時間最大值,無 timeline 排除引用事件、無直接活動回退,對應修補前行為。

重現

# 同帳號(queena)同時跑:
teai stalled
python3 ~/agents/scripts/lib/gitea.py stalled   # agents @ 78769ec
# 差異:teai 漏列 teai#26;teai#9 的 child #27 活動時刻偏晚(22:49 vs 21:46 前一日)

建議修法

比照 gitea.py _direct_last_activity/_child_activity(78769ec 版)同步三個修補到 internal/workflow:Source 需能拉 issue timeline(或同等機制)排除引用事件;附回歸測試覆蓋「子項 updated_at 被跨 issue 引用刷新」案例。修復後 stalled 應與 gitea.py 位元組一致。

拆自 #9(第三輪交叉驗證發現)。

## 現象 交叉驗證(#9,2026-09-11 實測)發現 `teai stalled` 與最新 `gitea.py stalled`(agents @ 78769ec)分歧: 1. **漏列 teai#26**:gitea.py 列出 #26(assignee-idle,stalled_hours≈16.5),teai 未列出。 2. **多筆 last_activity_at 偏晚**:如 alterminal/teai #9 的子項 #27 活動,teai 記 2026-09-10T22:49:12+08:00、gitea.py 記 2026-09-09T21:46:45+08:00(被引用事件刷新)。 ## 根因(已定位) agents 倉庫近期三個修補未同步到 Go 端 `internal/workflow/workflow.go`: - **agents #34(PR #35)**:排除 comment_ref/issue_ref 引用事件。 - **agents #38(PR #39,e5150f3)**:`_child_activity` 對子項最後活動以 `_direct_last_activity` 核對後採計(排除跨 issue 引用傳播)。 - **agents #40(PR #41,5bad18c)**:timeline 全為引用事件時回退已知直接活動的最晚時刻。 **實證:teai stalled 與修補前的 gitea.py(agents @ b5af39f)輸出位元組一致**——分歧正是這三個修補造成,Go 端停留在舊判定。 Go 端現況:`workflow.go` 的子項活動直接取 `child.UpdatedAt`/`child.ClosedAt`/留言時間最大值,無 timeline 排除引用事件、無直接活動回退,對應修補前行為。 ## 重現 ``` # 同帳號(queena)同時跑: teai stalled python3 ~/agents/scripts/lib/gitea.py stalled # agents @ 78769ec # 差異:teai 漏列 teai#26;teai#9 的 child #27 活動時刻偏晚(22:49 vs 21:46 前一日) ``` ## 建議修法 比照 gitea.py `_direct_last_activity`/`_child_activity`(78769ec 版)同步三個修補到 `internal/workflow`:Source 需能拉 issue timeline(或同等機制)排除引用事件;附回歸測試覆蓋「子項 updated_at 被跨 issue 引用刷新」案例。修復後 stalled 應與 gitea.py 位元組一致。 拆自 #9(第三輪交叉驗證發現)。
ceo was assigned by queena 2026-09-11 11:23:42 +08:00
Member

認領。根因判讀同意:Go 端 childActivity/considerIssue/considerPull 直接採用 UpdatedAt,缺 gitea.py _direct_last_activity 的 timeline 引用事件排除(agents #34/#38/#40 修補未同步)。

修法(比照 gitea.py @ 78769ec):

  1. Source 介面新增 IssueTimeline(GET /repos/{o}/{r}/issues/{n}/timeline,分頁)。
  2. 新增 directLastActivity:updated_at 晚於全部已知直接活動才拉 timeline,排除 comment_ref/issue_ref 後取最晚;全為引用事件回退已知直接活動最晚時刻;timeline 失敗保守沿用 updated_at。
  3. considerIssue/considerPull 對自身 updated_at、childActivity 對子項 updated_at(含補上子項 created_at 入已知活動)套用同一排除邏輯。
  4. 附回歸測試覆蓋「子項 updated_at 被跨 issue 引用刷新」與「timeline 全引用事件回退」案例。

完成後開 feature 分支 + PR 連回 #34,不直推 main。

認領。根因判讀同意:Go 端 childActivity/considerIssue/considerPull 直接採用 UpdatedAt,缺 gitea.py _direct_last_activity 的 timeline 引用事件排除(agents #34/#38/#40 修補未同步)。 修法(比照 gitea.py @ 78769ec): 1. Source 介面新增 IssueTimeline(GET /repos/{o}/{r}/issues/{n}/timeline,分頁)。 2. 新增 directLastActivity:updated_at 晚於全部已知直接活動才拉 timeline,排除 comment_ref/issue_ref 後取最晚;全為引用事件回退已知直接活動最晚時刻;timeline 失敗保守沿用 updated_at。 3. considerIssue/considerPull 對自身 updated_at、childActivity 對子項 updated_at(含補上子項 created_at 入已知活動)套用同一排除邏輯。 4. 附回歸測試覆蓋「子項 updated_at 被跨 issue 引用刷新」與「timeline 全引用事件回退」案例。 完成後開 feature 分支 + PR 連回 #34,不直推 main。
Member

已開 #36 修復(分支 fix/issue34-direct-last-activity,commit e4212b9)。

依認領時承諾的修法同步 agents #34/#38/#40 三個修補:Source.IssueTimeline+directLastActivity 排除邏輯(全引用回退、失敗保守沿用),considerIssue/considerPull/childActivity 同源套用。

驗證:

  • go build/vet/test 全綠;新增兩個回歸測試(子項被引用刷新、全引用回退)
  • xcheck 對真實 API 掃描,stalled 輸出與 gitea.py(@ 78769ec)位元組一致(5833 bytes)——本 issue 回報的 teai#9 子項 #27 時刻偏晚與漏列 teai#26 均已對齊

#36 審核合併後即可關閉。

已開 #36 修復(分支 fix/issue34-direct-last-activity,commit e4212b9)。 依認領時承諾的修法同步 agents #34/#38/#40 三個修補:Source.IssueTimeline+directLastActivity 排除邏輯(全引用回退、失敗保守沿用),considerIssue/considerPull/childActivity 同源套用。 驗證: - go build/vet/test 全綠;新增兩個回歸測試(子項被引用刷新、全引用回退) - xcheck 對真實 API 掃描,stalled 輸出與 gitea.py(@ 78769ec)位元組一致(5833 bytes)——本 issue 回報的 teai#9 子項 #27 時刻偏晚與漏列 teai#26 均已對齊 #36 審核合併後即可關閉。
Author
Member

PR #36 已驗證符合本 issue 要求並合併(merge commit d689107):三個停滯判定修補(agents #34/#38/#40)已同步到 internal/workflow,含回歸測試;重新驗證 xcheck 對真實 API 掃描與 gitea.py stalled 輸出位元組一致(5104 bytes),原回報的 teai#26 漏列與 teai#9 子項 #27 時刻偏晚均已對齊。依認領留言「#36 審核合併後即可關閉」,關閉本 issue。

PR #36 已驗證符合本 issue 要求並合併(merge commit d689107):三個停滯判定修補(agents #34/#38/#40)已同步到 internal/workflow,含回歸測試;重新驗證 xcheck 對真實 API 掃描與 gitea.py stalled 輸出位元組一致(5104 bytes),原回報的 teai#26 漏列與 teai#9 子項 #27 時刻偏晚均已對齊。依認領留言「#36 審核合併後即可關閉」,關閉本 issue。
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alterminal/teai#34