feat(subagent): 完成 #278 子代理取消/重试/恢复与标准事件流#346
Conversation
|
@xgopilot 先分析当前PR中可能存在哪些风险点,然后给我一个让AI能够进行review的提示词 |
| delete(state.running, outcome.id) | ||
| running, ok := state.running[outcome.id] | ||
| if ok { | ||
| delete(state.running, outcome.id) |
There was a problem hiding this comment.
state.running is deleted before verifying outcome.attempt matches the currently running attempt. For stale outcomes (older attempt arrives after a retry has already started), this removes the active run from tracking, and the real in-flight attempt can later be ignored (!ok path). Consider checking outcome.attempt == running.attempt first, and only deleting from state.running when it matches.
风险点分析
可直接给 AI 的 Review 提示词补充:本次仅做分析与审查建议,未修改代码。 |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
@xgopilot 你是 Go 代码审查助手,请严格按“只找问题不表扬”的方式审查 PR #346(分支对比:origin/main...HEAD)。 仓库背景:NeoCode,核心边界是 TUI -> Runtime -> Provider/Tools;本次 PR 主要改动在 subagent scheduler 的取消/重试/恢复与标准事件流。 请重点检查以下高风险维度,并按严重级别输出(High/Medium/Low):
输出格式要求:
|
FindingsHigh
Medium
Low
测试风险点
|
|
@xgopilot 帮我解决上述的review问题 |
|
已按你提到的 review 点完成修复并推到当前 PR 分支( 修复内容
新增/增强测试
本地验证
同步信息:push 后已更新 fork 侧 PR 链接( |
- keep running state on stale outcomes - include recovery-failed tasks in schedule summary - dedupe repeated subagent progress events - strengthen regression tests for stale/recovery/backoff Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: Cai-Tang-www <106404101+Cai-Tang-www@users.noreply.github.com>
背景
本 PR 对齐并完成 issue #278:为 subagent 补齐可用级执行可靠性(取消/重试/恢复)与可观测事件流。
Closes #278
本次改动
1) 调度可靠性(Scheduler)
continue_on_error/fail_fastretry/failin_progress任务,恢复到可重试或失败终态owner_type/owner_id,避免假锁定状态残留2) 超时与取消语义
context.Canceled与context.DeadlineExceededStopReasonTimeout)3) 事件可观测性
subagent_retriedsubagent_startedsubagent_progresssubagent_retriedsubagent_completedsubagent_failedsubagent_canceled测试
go test ./internal/subagent/... ./internal/runtime/...✅影响范围
internal/subagent/*internal/runtime/subagent_run.gointernal/runtime/events_subagent.go风险与说明
go test ./...当前仍受仓库既有用例internal/config中TestLoadCustomProvidersReadDirAndStatErrors/providers_dir_read_error影响(与本 PR 无关)。