Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#312 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
64/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Python
Star
18.2k
Fork
1.7k
Merge trung bình
4 ngày 1 giờ
Pull request đã merge (30 ngày)
10

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/SkillOpt

Tất cả issue của microsoft/SkillOpt

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.