feat(proactive): draft of upgrading proactive feature with disentangled job - #488
feat(proactive): draft of upgrading proactive feature with disentangled job#488imrewce wants to merge 14 commits into
Conversation
|
|
| @@ -1,5 +1,6 @@ | |||
| """Base job component for sequential step execution.""" | |||
|
|
|||
| import time | |||
There was a problem hiding this comment.
authentic daily link original sessions -- followup detection
There was a problem hiding this comment.
here is the proactive job for the reading side passing interest.md to upper layer application layer, so i suppose it is supposed to be deleted.
| tool_result_limit: 50000 | ||
| model_config: | ||
| max_retries: 1 | ||
| proactive: |
| return 0.5 | ||
|
|
||
|
|
||
| class ProactiveTopic(BaseModel): |
|
感谢这次 proactive 功能的重构。整体方向是清楚的:把 idle sensing、素材提取、topic 处理和 catalog checkpoint 拆开之后,职责比原来的单一步骤更容易理解;测试覆盖也比较充分。我仔细看了完整 diff、相关 Job 生命周期、默认配置和 proactive 的 LLM/文件处理链路。目前 GitHub 上的 Python 3.11/3.12/3.13 unit tests、pre-commit、CLI smoke 和 CodeQL 都已通过。 不过,从正确性和后续维护成本来看,我建议合并前再收敛一轮,重点如下。 1. LLM 输出需要真正进行严格校验,否则可能错误 checkpointPR 新增了 followups:
- title: ...即使顶层字段拼错,它仍然是一个非空 dict,因此不会触发 parse retry。后续 建议:
需要注意的是,当前 2. BaseJob/CronJob 的 idle sensing 建议进一步解耦和精简这里我认同“Job 只是辅助感知其他状态”的思路,但目前 目前有两个具体问题:
建议把这部分收敛成一个很薄的 {
"active_count": 2,
"last_start": ...,
"last_end": ...,
}执行开始时 这样 BaseJob 可以继续专注于构造 RuntimeContext 和顺序执行 steps;CronJob 只保留 cron 调度、stop event 和异常日志,单次 step 执行可以复用公共 对应测试建议覆盖:
3. default.yaml 建议精简,并考虑让新的 cron 显式启用当前修改会让所有使用默认配置的升级用户自动增加每天 4 次 proactive LLM 调用,解析失败时每轮还可能重试;同时会自动新增 建议:
4. LLM 结构化输出可以显著简化当前要求 LLM 输出 可以考虑收敛为类似: topics:
- type: follow_up
title: ...
reason: ...
path: ...
strength: intent
updated:
- id: ...
path: ...
strength: explicit
resolved:
- topic-id然后由代码完成:
这样 LLM 只负责语义判断,代码负责结构拼装和规则执行,会更符合这里的可靠性目标。 5. 增加整个 prompt 的总预算现在 建议增加 6. 文档和当前 PR 状态这次新增了 另外 GitHub 当前仍将 PR 标记为 总体上,我建议保留“LLM 做语义识别、代码做规则和拼装”的核心方向,但把 LLM contract、Job activity tracking 和默认配置再缩小一些。这样不仅代码量会下降,也能避免模型偶发格式错误变成不可恢复的漏处理。辛苦了,期待下一版。 |
- rename read-side job 'proactive' -> 'proactive_read' (less confusing vs the refresh pipeline) - drop dedicated agent_wrapper.proactive; extraction reuses the default wrapper - simplify schema: remove unused ProactiveExtractOutput/TopicUpdate, drop resource_paths - extract no longer scans resource/ directly (daily notes already carry resource content) - update tests and docs accordingly
- parse_extract_reply now requires a contract section (follow_ups/extends/updates as a list); non-empty replies with misspelled section names trigger the existing one-shot retry instead of silently checkpointing changed files - pack_paths gains max_total_chars; extract packs newest daily material first, keeps the first file on overflow, and records omitted files in a trailer (default budget 300000 chars, configurable via max_total_chars) - tests: schema gate unit, schema-error retry e2e, budget unit + e2e
…LM contract - extract/plan/agenda now draw a user profile block from <digest_dir>/personal/*.md (frontmatter description + body excerpt, per-file budget, profile.md fallback) - all daily access honours the configured daily_dir (prompt paths parameterized, config-driven fallbacks) so workspaces using e.g. memory/ work unchanged - schema trim: drop dead fields errors/material_paths, carry_forward_all -> count - shrink LLM output contract: new topics emit title/reason/confidence/paths only; keywords removed end-to-end, evidence derived from paths[0] (updates keep it)
…er retry Two consecutive unparseable replies now short-circuit the round without checkpointing, so the same material is retried next round instead of being silently consumed (closes the residual audit agentscope-ai#1 gap: the structural gate detected schema-wrong output but a double failure still checkpointed).
|
Opinion #1 — Strict LLM output validation: ADDRESSED Opinion #2 — Concurrency guard: DESIGNED, DEFERRED Opinion #3 — default.yaml hygiene: PARTIALLY ADDRESSED Opinion #4 — Leaner structured output: PARTIALLY ADDRESSED Opinion #5 — Total prompt budget: ADDRESSED Opinion #6 — Docs & PR state: PARTIALLY ADDRESSED Beyond the audit: generative scenario-card plan step + list-wise agenda with auditable silence; digest-personal profile personalization; config-driven |
Addressed in the latest commit |
|
感谢这次 proactive 链路的重构,整体拆分方向比较清晰,尤其是把 extract/topics/plan/agenda/finish 分成独立 Step,以及为失败路径补充 fallback 和 checkpoint 语义,后续维护会更容易。 我本地 checkout 后完整看了一遍改动,并运行了相关测试。这里整理了一些建议在合并前确认的问题,其中前几项可能直接影响默认配置下的运行或兼容性。 1. 默认配置下 proactive v2 与 dream cron 的格式不兼容当前默认配置同时启用了:
但 本地用 proactive 的 这意味着 proactive 当天成功写入后,23:00 的默认
最好补一个按照默认 cron 顺序运行 proactive → dream 的回归测试。 2.
|
…ore job tree to upstream
…eckpoint, wider fallbacks, profile containment, horizon content, expiry boundary)
… is now the sole writer
|
New commit addresses the #1 issue: Dream currently only produces digest content. The dream package contains zero references to proactive / |
Summary
add new proactive cron job consisting of idle sensing/ extracting / topics filtering steps and structured proactive schema
Related issue
Contract and data impact
Validation
pre-commit run --all-filespasses, or omitted checks are explained belowwebsite/changedChecklist
Screenshots or additional notes