docs: #19 工具链事件中枢上下文四层改造方案 #2
Closed
pangtong-fujunshi
wants to merge 33 commits from
docs/19-toolchain-context-layers into main
pull from: docs/19-toolchain-context-layers
merge into: sanguo:main
sanguo:main
sanguo:docs/20-issue-centric-orchestration
sanguo:impl/17-issue-assigned-git-steps
sanguo:docs/17-issue-assigned-git-steps
sanguo:impl/17-ci-deploy-steps-branching
sanguo:docs/19-fix-delivery-mode
sanguo:docs/17-ci-deploy-steps-branching
sanguo:fix/91-ci-lint-ensurepip
sanguo:impl/19-s6-deprecated-cleanup
sanguo:docs/19-cron-config-design
sanguo:fix/spawner-get-task-info-must-haves
sanguo:docs/skill-lifecycle-design
sanguo:fix/spawner-event-type-missing
sanguo:design/mail-verify-prompt-fix
sanguo:feat/runaway-guard
sanguo:fix/mention-duplicate-mail-race-doc-sync
sanguo:feat/l0-l2-prompt-improvements
sanguo:feat/toolchain-from-to-filter
sanguo:fix/task-sort-desc
sanguo:refactor/toolchain-to-settings
sanguo:fix/cd-push-trigger-yaml
sanguo:ci/add-frontend
sanguo:feat/toolchain-tab
sanguo:refactor/api-split-expand
sanguo:docs/18-api-refactor-design
sanguo:docs/rewrite-s26-conventions
sanguo:feat/gitea-conventions
sanguo:impl/16-knowledge-injection
sanguo:docs/16-knowledge-injection-v2
sanguo:docs/16-knowledge-injection
sanguo:fix/ci-pip-upgrade
sanguo:feat/17-toolchain-handler-impl
sanguo:fix/17-toolchain-mail-separation
sanguo:fix/17-on-failure-redesign
sanguo:feat/17-toolchain-handler-enforcement
sanguo:feat/17-action-mail-type
sanguo:fix/docs-path-ref-15
sanguo:fix/pr-synchronize-dispatch
sanguo:docs/design-renumber
sanguo:fix/g2-agent-error-reason-map
sanguo:feat/mail-notify-v2
sanguo:chore/docs-merge-mail-failure
sanguo:chore/docs-rename-watchdog
sanguo:chore/docs-merge-3-batch
sanguo:chore/docs-merge-2-3
sanguo:chore/docs-merge-1-review-to-archive
sanguo:chore/docs-cleanup
sanguo:chore/g1-comment-fix
sanguo:fix/is-pr-detection
sanguo:docs/25-sync-help-keywords
sanguo:feat/25-gitea-mention-toolchain
sanguo:fix/auto-deploy-self-kill
sanguo:feat/43-auto-deploy-on-merge
sanguo:fix/39-review-merge-reminder
sanguo:docs/38-toolchain-design-update
sanguo:fix/toolchain-event-type-registration
sanguo:fix/toolchain-synchronize-fallback-and-merge-notify
sanguo:fix/24-compact-detection-v4
sanguo:fix/compact-detection-v3
sanguo:feat/pr-lifecycle-events
sanguo:fix/lint-cleanup
sanguo:fix/sync-to-gitea
sanguo:feat/step5-engine-integration
sanguo:feat/task-type-handlers-step2-4
sanguo:docs/s-fixes
sanguo:docs/task-type-architecture
sanguo:docs/merge-19-into-13
sanguo:fix/frontend-null-vs-undefined
sanguo:fix/e2e-collection-crash
sanguo:fix/deploy-workflow
sanguo:fix/lint-regression
sanguo:fix/ci-dedup-and-notify-fix
sanguo:docs/19-toolchain-context-layers-v2
sanguo:docs/19-toolchain-context-layers-only
sanguo:fix/toolchain-review-dedup-ci-cooldown
sanguo:feat/webhook-test
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "docs/19-toolchain-context-layers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
审查结论:REQUEST_CHANGES
PR 包含两部分改动:已完成修复(bug fix + E2E 验证记录)和设计方案(#19 上下文四层改造)。修复部分质量高,设计方案有问题需要讨论。
✅ 确认通过的部分
1. Review 去重修复(toolchain_routes.py)
2. 双格式兼容(toolchain_routes.py)
3. inform Mail crash 误标 done 修复(dispatcher.py)
_mail_auto_complete增加 outcome 参数,inform 类型用白名单控制 done 标记4. Spawner crash cooldown 调整(spawner.py)
5. 测试配置优化(conftest.py + pyproject.toml)
pytest_collection_modifyitems实现默认排除 integration/e2e,解决安全隐患pytest直接跑是安全的,不需要记住-m "not e2e"6. 健康检查端点(main.py)
/api/healthz轻量级,无需认证,适合 Docker/负载均衡器探活7. E2E 验证记录(docs/design/18-toolchain-e2e-test.md)
🔴 必须修(M1)
M1. [docs/design/19-toolchain-context-layers.md] 方案声称改 AGENTS.md(#1 改动项),但 PR 不含 AGENTS.md 文件
方案第五章改动清单第 1 项:"6 个 Agent 的 AGENTS.md 加工具链协作段(内容统一)"。
PR 实际文件列表中没有 AGENTS.md。两种可能:
无论哪种,当前 PR 的标题是"docs: #19 工具链事件中枢上下文四层改造方案",但 PR 同时包含了 bug fix 代码(去重、双格式、crash cooldown、healthz)。建议拆分:
混合在一个 PR 里,审查范围不清晰,合并后难以追溯。
🟡 建议改(不阻断 merge)
S1. [docs/design/19-toolchain-context-layers.md §3.2] extract_mentions 前缀模糊匹配有误匹配风险
@jiang会匹配jiangwei-infra(正确),但@z会匹配zhaoyun-data(第一个包含 z 前缀的)。AGENT_IDS 的遍历顺序不确定(set/dict),建议前缀匹配要求至少 3 个字符,或只依赖精确匹配+别名映射。S2. [docs/design/19-toolchain-context-layers.md §4.2] 工具链 Mail 改 request 类型的影响面未评估
当前所有工具链 Mail 走
type=inform,spawn prompt 说"已阅即可"。改为request后,Agent 收到 Mail 后必须回复,否则会走no_reply_found→ 标 failed。对 Review 请求(simayi-challenger)这不是问题。但对 Issue 指派通知,如果任务本身不需要 Agent 回复(比如信息性指派),改 request 会导致大量 failed Mail。
建议改为:只有
review_request和issue_assigned改 request,其他保持 inform。或者在方案中明确所有工具链 Mail 都需要回复。S3. [docs/design/18-toolchain-e2e-test.md] E2E 记录中根因分析前后矛盾
文档同时记录了两个互相矛盾的根因:
建议在步骤 3/4 的注释中也标注更正,否则读者会困惑。
🟢 小问题
L1. [docs/design/19-toolchain-context-layers.md] 模板中硬编码了 IP 地址
gitea_api: "http://192.168.2.154:3000/api/v1"出现在多个模板示例中。建议用环境变量或配置项,和其他代码中的_GITEA_BASE保持一致。[CI] 失败
分支: 2
触发 commit:
8085a71d9fd0e8c383fa98216d934f4996c650f8请检查 CI 日志并修复。
Pull request closed