evolve plugin: keep unsent turns, and a learning call in progress, across a config reload
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 15/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- go
调研方向
Start from the review thread on PR #2028 and docs/evolve-plugin.md ("What is learned from"). Then read the evolve plugin's Shutdown, process_trajectory and its recorder/batch-send path to see where unsent turns, retry slots and batch sequence live, plus the reloader's drainWindow handling. Option 2 is the smallest first slice; done means a reload neither drops unsent turns nor cancels an in-flight learning call, with tests for both and the doc updated.
由索引模型根据 Issue 内容生成。
描述
Follow-up to #2028, from review.
Problem
A config reload replaces the evolve plugin's instance. The reloader swaps in new pipelines and stops the old ones once their requests drain (at most drainWindow, 10 minutes). Stopping the old instance calls Shutdown, which:
- drops every session's unsent turns. These are the turns recorded since the session's last batch was sent, which can be up to
idle_after_seconds(15 minutes) of work per session. - cancels a learning call in progress.
process_trajectoryruns evolve's LLM before it answers, so this can throw away minutes of work. Evolve may or may not have committed the batch.
A change to any plugin's config triggers a reload, agentop's plugin toggles included, so this happens far more often than a restart.
Since #2028 the new instance no longer sends a session's history again: it starts at each session's next prompt, with the session's task as context. So nothing is learned twice, but the turns that were waiting at the reload are never learned.
Options
- Hand the sessions over within the process. The old instance passes its recorders (unsent turns, retry slots, batch sequence) to the new one: for example, through a package-level registry keyed by the plugin's endpoint and namespaces. The new instance adopts a session's recorder the first time it sees that session. The old instance keeps recording while it drains, so the handover has to happen at
Shutdown, or the two instances must share the recorders. - Let a learning call in progress finish.
Shutdownstops the ticker but lets a call in progress finish within its context, instead of cancelling it. - Persist unsent turns in Cortex's plugin state store (
plugin-state.json). That covers restarts too, and would need a size bound.
Option 2 is small and independent of the others. 1 or 3 is the larger part.
Done when
- After a reload, turns recorded by the old instance and not yet sent are sent exactly once, by one of the two instances, under batch ids evolve hasn't seen.
- A reload doesn't cancel a learning call in progress, within a stated bound.
- Tests cover both, and
docs/evolve-plugin.md("What is learned from") describes the result.
Assisted-By: Claude (Anthropic AI) [email protected]
- 主要语言
- Go
- 星标
- 31
- 派生
- 49
- 平均合并
- 9 小时 43 分钟
- 30 天内合并 PR
- 367
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rossoctl/cortex 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug laptop
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
相似的 Issue
-
taskmanager: a failed v1alpha1 backup leaves the partial backup behind可能已有人在做 @arshil42 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 80/100
ether/etherpad-go#571 ·
维护者通常 1 天内回复
-
labeler: read a limit above math.MaxInt as math.MaxInt in nonNegative (CodeQL alerts #20 and #21)未关闭cost:approved factory:queued factory:tracking priority:p2 rank:12 ready-for-doing task:approved tokens:50k
难度 2/5 1-3 小时 新手友好度 88/100
sisaku-security/sisakulint#860 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100