Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

skillopt-sleep: harvest checkpoint is keyed by project, so a second --source in the same project skips its unseen sessions

未关闭
#312 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
64/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

Read cycle.py and the state methods last_harvest_for and set_last_harvest, then trace how the selected transcript source reaches the harvest call. The issue names both checkpoint write branches: the no-tasks branch and the normal end of a stateful run. Update checkpoint handling so each source retains its own cursor while existing state can still be read; reproduce with the mock backend and confirm the second codex dry-run finds its previously unseen sessions.

由索引模型根据 Issue 内容生成。

描述

What happens

skillopt-sleep run stores one harvest checkpoint per project, whatever --source the run used. cycle.py reads state.last_harvest_for(project) before harvesting and calls state.set_last_harvest(project, started) after every stateful run (both the no-tasks branch and the normal end). So when one project is fed from several transcript sources, one night per source, every source after the first only sees sessions newer than the first run's start: its older, never-harvested sessions are skipped for good. Each source is a separate store with its own timestamps, so a single shared cursor cannot be right for all of them.

Repro (mock backend, isolated state, no model calls)

Version: main at 343db229dbd5ddaf9df6b1d5540d8bcdb2604d5c, installed with uv tool install "skillopt @ git+https://github.com/microsoft/SkillOpt", Python 3.14, macOS. --claude-home points the state at a scratch dir; P is an empty scratch project.

T=$(mktemp -d); mkdir -p $T/.claude $T/proj
common="--project $T/proj --scope all --backend mock --claude-home $T/.claude --progress"
skillopt-sleep dry-run $common --source codex   # harvest done: sessions=60
skillopt-sleep run     $common --source cursor  # stateful; sets last_harvest[$T/proj]
skillopt-sleep dry-run $common --source codex   # harvest done: sessions=0

(Our Codex sessions are CLI rollouts, so we pass --codex-home pointing at a dir whose archived_sessions/ symlinks ~/.codex/sessions/**/rollout-*.jsonl; see #282.)

The second codex dry-run harvests nothing although no codex session was ever harvested: it inherited the cursor run's checkpoint.

Expected

Each source keeps its own checkpoint.

Suggested fix

Key last_harvest by f"{project}::{transcript_source}" and fall back to the bare project key when reading existing state, or accept several --source values in one run so one checkpoint covers them together.

Workaround we use

A wrapper keeps one cursor per source in its own file and writes it into state.json before each per-source run.

主要语言
Python
星标
18.2k
派生
1.7k
平均合并
4 天 1 小时
30 天内合并 PR
10

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/SkillOpt 的其他 Issue

查看 microsoft/SkillOpt 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。