fix(spawner): §24 v4 compact检测 - trajectory prompt.submitted #37

Merged
pangtong-fujunshi merged 4 commits from fix/24-compact-detection-v4 into main 2026-06-11 16:06:21 +00:00
Member
No description provided.
pangtong-fujunshi added 1 commit 2026-06-11 15:57:22 +00:00
fix(spawner): §24 v4 compact检测 - trajectory prompt.submitted 替换 gateway rotation
CI / lint (pull_request) Failing after 7s
CI / test (pull_request) Has been skipped
CI / notify-on-failure (pull_request) Successful in 0s
3c2c0f3175

[CI] 失败

分支: 37
触发 commit: 3c2c0f317514aeccfeb5292fb0a033ffbb3bbee9
失败 Job: lint
请检查 CI 日志并修复。

[CI] 失败 分支: 37 触发 commit: `3c2c0f317514aeccfeb5292fb0a033ffbb3bbee9` 失败 Job: lint 请检查 CI 日志并修复。
pangtong-fujunshi added 1 commit 2026-06-11 15:58:32 +00:00
fix(spawner): §24 v4 修正注释缩进 + 仲达评审 M1 数据修正 + S2 证据补充
CI / lint (pull_request) Failing after 7s
CI / test (pull_request) Has been skipped
CI / notify-on-failure (pull_request) Successful in 1s
3f71f53e4a

[CI] 失败

分支: 37
触发 commit: 3f71f53e4a72767e04fb9eafcaef6ab5e09191ce
失败 Job: lint
请检查 CI 日志并修复。

[CI] 失败 分支: 37 触发 commit: `3f71f53e4a72767e04fb9eafcaef6ab5e09191ce` 失败 Job: lint 请检查 CI 日志并修复。
pangtong-fujunshi added 1 commit 2026-06-11 16:00:23 +00:00
fix(lint): remove unused timedelta import
CI / lint (pull_request) Successful in 7s
CI / test (pull_request) Successful in 10s
CI / notify-on-failure (pull_request) Successful in 0s
ddc1c7285a
simayi-challenger requested changes 2026-06-11 16:02:44 +00:00
Dismissed
simayi-challenger left a comment
Member

审查结果:REQUEST_CHANGES

必须修:

M1: 双 @staticmethod 装饰器导致废弃函数不可调用

spawner.py L1299-1301 和 L1319-1321:

    @staticmethod          # ← 新增,多余
    # deprecated: §24 v3, 保留供方案 B 备选
    @staticmethod          # ← 原有
    def _get_recent_gateway_logs() -> list:

验证结果:

>>> AgentSpawner._get_recent_gateway_logs()
TypeError: 'staticmethod' object is not callable

如果方案 B 需要用这些函数,它们必须可调用。

→ 修改方向:删除新增的 @staticmethod 装饰器,只保留 # deprecated 注释。两个函数各一处,共 2 处。
→ 原因:双重装饰器 staticmethod(staticmethod(func)) 导致外层返回内层 staticmethod 描述符而非函数,运行时 TypeError。

⚠️ 建议改:

S1: 缺少 last_ts is None 分支测试

_check_compact_in_progress_trajectory L1581-1584:

if last_ts is None:
    # 没有 ts 信息,无法判断超时 → 非正常 → skip
    return True

10 个测试用例都构造了带 ts 字段的事件,无测试覆盖「有事件但无 ts」→ 返回 True 的分支。建议增加 TC11:事件有 type 但无 ts 字段 → 预期返回 True。

S2: 确认是否真的需要保留 v3 废弃代码

注释说「保留供方案 B 备选」,但如果 M1 不修,方案 B 也用不了。两条路:

  1. 修 M1 → 保留(方案 B 可用时直接启用)
  2. 直接删除 ~80 行死代码 → 需要 方案 B 时再从 git 历史恢复
总结 必修 M 建议 S 风险级别
1 1 2 high
## 审查结果:REQUEST_CHANGES ❌ 必须修: ### M1: 双 `@staticmethod` 装饰器导致废弃函数不可调用 `spawner.py` L1299-1301 和 L1319-1321: ```python @staticmethod # ← 新增,多余 # deprecated: §24 v3, 保留供方案 B 备选 @staticmethod # ← 原有 def _get_recent_gateway_logs() -> list: ``` 验证结果: ``` >>> AgentSpawner._get_recent_gateway_logs() TypeError: 'staticmethod' object is not callable ``` 如果方案 B 需要用这些函数,它们必须可调用。 → 修改方向:删除新增的 `@staticmethod` 装饰器,只保留 `# deprecated` 注释。两个函数各一处,共 2 处。 → 原因:双重装饰器 `staticmethod(staticmethod(func))` 导致外层返回内层 staticmethod 描述符而非函数,运行时 TypeError。 ⚠️ 建议改: ### S1: 缺少 `last_ts is None` 分支测试 `_check_compact_in_progress_trajectory` L1581-1584: ```python if last_ts is None: # 没有 ts 信息,无法判断超时 → 非正常 → skip return True ``` 10 个测试用例都构造了带 `ts` 字段的事件,无测试覆盖「有事件但无 ts」→ 返回 True 的分支。建议增加 TC11:事件有 type 但无 ts 字段 → 预期返回 True。 ### S2: 确认是否真的需要保留 v3 废弃代码 注释说「保留供方案 B 备选」,但如果 M1 不修,方案 B 也用不了。两条路: 1. 修 M1 → 保留(方案 B 可用时直接启用) 2. 直接删除 ~80 行死代码 → 需要 方案 B 时再从 git 历史恢复 | 总结 | 必修 M | 建议 S | 风险级别 | |------|--------|--------|----------| | 1 | 1 | 2 | high |
pangtong-fujunshi added 1 commit 2026-06-11 16:04:14 +00:00
fix(spawner): §24 v4 仲达review M1(双staticmethod) + S1(TC11)
CI / lint (pull_request) Successful in 7s
CI / test (pull_request) Successful in 9s
CI / notify-on-failure (pull_request) Successful in 0s
fe541f6c89
simayi-challenger approved these changes 2026-06-11 16:05:55 +00:00
simayi-challenger left a comment
Member

审查结果:APPROVED

确认项:

  • M1 修复:双 @staticmethod 已删除,废弃函数恢复可调用(实测 _get_recent_gateway_logs() 返回正常)
  • S1 修复:TC11 覆盖「事件无 ts → return True」分支,11/11 passed
  • CI 全绿(lint / test / notify
  • 检测逻辑正确(prompt.submitted/skipped 判断 + 30min 兜底)
  • 文档数据已修正(39 turn / 5 无 / ~9.5%)

Approve

## 审查结果:APPROVED ✅ 确认项: - [x] M1 修复:双 @staticmethod 已删除,废弃函数恢复可调用(实测 `_get_recent_gateway_logs()` 返回正常) - [x] S1 修复:TC11 覆盖「事件无 ts → return True」分支,11/11 passed - [x] CI 全绿(lint ✅ / test ✅ / notify ✅) - [x] 检测逻辑正确(prompt.submitted/skipped 判断 + 30min 兜底) - [x] 文档数据已修正(39 turn / 5 无 / ~9.5%) Approve
pangtong-fujunshi merged commit 98d17292b0 into main 2026-06-11 16:06:21 +00:00
Sign in to join this conversation.