Repository navigation
Conversation
|
LoopForge PR Review — head Verdict: ❌ Fail
Blocking: real merge conflict with |
|
已解决与最新 针对性测试、 |
|
LoopForge PR Review — head Verdict: ✅ Pass
No blocking issues found; local build/vet/tests are green and the previously-blocking merge conflict is resolved without regressing #546's per-task concurrency fix. |
Yanami-2K
left a comment
There was a problem hiding this comment.
核对了 AI 定时任务引用项目资产的后端与前端改动。normalizeScheduledReferences 只接受 6 种类型,上限 12 个,去重并去掉空白。它复用 workbenchReference 校验存在性和项目/共享可见性,只持久化 type+id,客户端伪造的 name/projectId 不会落库。每次执行都重新解析资产,引用不可用时在调用模型前就失败;派发类任务会清空 references。putTask 顺带补上了 workbenchProjectAllowed 项目权限校验。新增测试断言了规范化结果、存储只保留身份、显示数据刷新、提示词里用的是最新标题而非伪造名称、缺失引用不触发生成,CI 全绿且与 main 无冲突。
一点产品层面的提醒(不阻塞):被引用的需求或运行被删除后,这个周期任务每次都会报错,直到有人编辑它。可以考虑在任务列表里标出失效的引用。另外 #664 也在改 ScheduleJob 和 sync-schedule.js,后合入的一方需要处理冲突。assistant_schedule.go 等文件的 patch 有截断。
|
当前 Review 和 CI 均已通过,请问这个功能是否还有产品或设计方面需要确认的事项?如无其他阻塞,麻烦方便时协助合并,谢谢。 |
Preserve upstream execution identity, shared-key model restrictions, fixed-session history and session retention alongside asset references. Add regression coverage for session modes, shared keys, saved state and reference-picker Escape handling.
|
已合并最新 main 并解决冲突,最新提交为 |
|
已再次同步最新 main,解决与 Runner 账号登录改动的冲突,最新提交为 |
Merge upstream/main at 451d38c. Reconcile internal/httpapi/schedule_runner_login_test.go by keeping upstream's Claude Code and Antigravity cases and both scheduled asset reference and API-key fallback assertions. Validation: targeted schedule, assistant-task, runner-login and dispatch Go tests; 33 schedule web tests; chatbot build; go build ./...; go vet on httpapi, domain and web.
|
已推送提交 |
cocofhu
left a comment
There was a problem hiding this comment.
整体方向没问题:只持久化 type+id、每次执行重新解析、客户端伪造的 name/projectId 不落库、派发任务清空 references 都做得对。我在 e85c8df 上跑了 go test ./internal/httpapi -run 'Schedule|Scheduled|AssistantTask|RunnerLogin',全部通过。有一个问题需要合并前修复。
需要修复:固定会话会把引用的需求永久绑定为主需求
定时任务实际走普通对话流程,所以会触发 linkMentionedIssue:首次执行时,引用的需求会被写进会话的 IssueID。此后每一轮,prepareWorkbenchContext 都会按 IssueID 读取并校验这个需求。
- 新会话模式不受影响,每次都新开会话。
sessionMode=fixed时绑定会一直留在固定会话里。用户在任务里移除这个引用后,每轮仍会注入该需求的上下文。- 需求随后被删除时,任务每次执行都会失败,而且在编辑界面里无法修复。
复现步骤:固定会话,引用需求 A 运行一次,此时 session.IssueID == A;清空 references 并删除需求 A,再运行一次,复用同一会话并报错 需求不存在或不属于当前项目。
修复方向,二选一即可:
- 来源为
AssistantSourceScheduled的会话跳过linkMentionedIssue; - 或者执行前,如果会话的
IssueID不在当前 references 中,就清除它。
请补一个"固定会话 + 移除引用 + 删除需求"的回归测试。
非阻塞建议
- 列表接口的开销和失效提示。
visibleScheduleJobs每次列出任务都会对每个引用调用scheduledMessageReferences,run类型要读完整的RunState,任务运行时前端还会轮询。另外解析是全有或全无:只要一个引用失效,这个任务的所有引用都退回成只有 id,用户看不出是哪个坏了。建议按单个引用分别解析,并标记失效项(与前面提到的"失效引用提示"是同一件事)。 - 重复解析。 一次执行中
runScheduleJobPromptReporting和executeAssistantTask各调用一次normalizeScheduledReferences,加上scheduledMessageReferences和对话流程里的accessibleWorkbenchReference,同一批引用大约解析四次。可以去掉runScheduleJobPromptReporting中那次。scheduledMessageReferences里按类型查所属项目的逻辑,也和accessibleWorkbenchReference基本重复,可以考虑复用。 putTask权限收紧。 新增的workbenchProjectAllowed对没有引用的老任务同样生效,已不是项目成员的用户将无法再编辑自己的老任务。方向是对的,但属于范围外的行为变化,建议在 PR 描述中说明。- 小问题:
CloneAssistantReferences注释写的是 "independent copy",但Element是指针,实际是浅拷贝;而且它在scheduleJobs里作用于刚解码的数据,可以直接删掉。- 前端选择器固定请求
offset=0,没有翻页。
|
但这个提交合并 main 后编译失败, 原因是 main 上的 #1123( refs, err := h.normalizeScheduledReferences(job.ProjectID, job.References)
if err != nil {
return "", "", err
}git 层面没有冲突,所以 GitHub 显示可合并,但 CI 测的是合并后的代码。请同步最新 main,并把这里改成 我在本地用合并结果试过这一处改动: |
Use the existing workbench fixture so the conversation executor can load SSH host trust without dereferencing a nil repository. Keep the CLI version and source assertions intact.
|
本地实测了 环境: PR head 编译的平台 + MySQL 8.0,内置前端用 1. 选择引用选择器能列出当前项目的仓库、需求、角色、技能,按类型筛选和关键字搜索都正常,选中后显示"已引用"并生成标签。 保存后数据库里只存了 type 和 id: 2. 修改资产后,运行时读取最新内容把需求标题改成「登录页支持扫码(v2 最新标题)」后,重新打开编辑器,标签显示新标题: 固定会话下连续执行两次:第一轮 prompt 里是旧标题,改名后第二轮是新标题。消息下方显示了引用标签。会话的 3. 引用的资产被删除删除「临时需求」后执行,在调用模型前就失败了,没有打开会话,错误信息写明了哪个资产不可用: 在编辑器里移除这个引用并保存(任务保持停用状态,没有被自动启用),再执行一次就成功了,而且仍然在同一个固定会话里继续(3 轮共 6 条消息, 实测确认的非阻塞问题只要有一个引用失效, 建议按单个引用分别解析,并把失效的标签标红或标注"已失效"。这一点可以放到后续 PR 处理。 |
cocofhu
left a comment
There was a problem hiding this comment.
之前提的问题都已修复:固定会话不再绑定主需求(ab804f3),和 main 合并后的编译错误已修(5b85a0e)。CI 全部通过,本地实测也正常,详见上一条评论。失效引用的提示可以放到后续 PR 处理。LGTM。







What changed
AI scheduled tasks previously accepted plain-text prompts without explicit project asset references. This adds selection of roles, skills, SOPs, issues, runs, and repositories to scheduled tasks, with search, filtering, removal, and a limit of 12 references.
The implementation reuses the existing assistant reference API and workbench context resolution. Only reference type and ID are persisted; each execution resolves the current asset. References are validated for supported types, existence, and project/shared visibility. Upstream execution identity, credential selection, session history/retention, and permission behavior are preserved.
Scope
Compatibility
The references field is optional in the existing JSON payload. Existing scheduled tasks without references continue to work. No database schema migration or runner protocol change is required.
Validation
The following checks passed locally after merging
mainat1535886:go build ./...go vet ./internal/httpapi ./internal/domain ./internal/repo ./webgo test ./internal/httpapi ./internal/domain ./internal/repo ./web -run 'Schedule|Scheduled|AssistantTask|Dispatch|SharedSkill|TestAppJSParses|TestAppBundleFilesAreEmbeddedAndListed' -count=1 -timeout=180snode --check web/app/sync-schedule.jspython3 scripts/check-public.pygit diff --checkNew regression coverage exercises asset references with both new/fixed conversations and personal/shared keys, refreshes referenced asset data on each run, rejects missing references before a conversation opens, and preserves paused state and unsaved drafts in the editor.
The complete repository test and acceptance checks continue through pull request CI and the maintainer environment.
Safety
Classic bundles and third-party licensing changes are not applicable to this change.