Repository navigation
Conversation
Add a native harvest source for Kimi Code sessions (wire.jsonl), so `--source kimi` works alongside claude/codex/cursor/pi/opencode. - skillopt_sleep/harvest_kimi.py: parses the two wire message envelopes (context.append_message, agent.message.appended), keeps only genuine user input (origin.kind == 'user'), skips system reminders/injections and think blocks, and reuses the shared meta-prompt filter, secret redaction, and feedback detector. Chinese feedback phrases are added because Kimi Code sessions are predominantly Chinese. - Wires record no cwd, so the digest project is the workspace slug (wd_358_<hash> -> '358'); invoked-scope matching is name-based against the invoked project path segments. - config.py: kimi_home default (~/.kimi-code) + kimi_sessions_dir. - harvest_sources.py: route transcript_source == 'kimi'. - __main__.py: --kimi-home override and 'kimi' --source choice. - tests/test_harvest_kimi.py: 7 offline tests (envelopes, reminders, since window, scope matching, source routing). Verified end-to-end on Windows: dry-run --source kimi harvests 66 sessions from ~/.kimi-code/sessions and runs the full harvest -> mine -> replay -> consolidate -> gate cycle.
Author
|
@microsoft-github-policy-service agree |
…vest The kimicode backend (and any headless replay) persists wires into ~/.kimi-code/sessions, so the next night's incremental harvest was eating those programmatic sessions instead of real user work — mining zero tasks after a killed run. Skip digests with no user intent and prompts carrying the attempt-template sentinel or a [skillopt-sleep: marker.
lucatreiber2007
added a commit
to lucatreiber2007/SkillOpt
that referenced
this pull request
Nov 1, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
lucatreiber2007
added a commit
to lucatreiber2007/SkillOpt
that referenced
this pull request
Nov 1, 2026
Tests schlagen auf macOS fehl (Kimi-Pfad/Slug bzw. bash-3.2-Syntax). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a native Kimi Code harvest source so
python -m skillopt_sleep --source kimiworks alongside claude/codex/cursor/pi/opencode. Kimi Code (the Kimi agent CLI/desktop app) stores sessions aswire.jsonlunder~/.kimi-code/sessions/wd_<workspace>/session_<id>/agents/main/, which the existing sources cannot read.Changes
skillopt_sleep/harvest_kimi.pycontext.append_message,agent.message.appended), keeps only genuine user input (origin.kind == "user"), skips system reminders/injections andthinkblocks; reuses the shared meta-prompt filter, secret redaction, and feedback detector; adds Chinese feedback phrases (谢谢/不对/重来...) since Kimi Code sessions are predominantly Chineseskillopt_sleep/config.pykimi_homedefault (~/.kimi-code),kimi_sessions_dirskillopt_sleep/harvest_sources.pytranscript_source == "kimi"branchskillopt_sleep/__main__.py--kimi-home,kimiin--sourcechoicestests/test_harvest_kimi.pyDesign notes
Wires do not record the session cwd, so the digest
projectis the workspace slug (wd_358_<hash>→358) and invoked-scope matching is name-based: a session is in scope when its slug appears among the invoked project's path segments. Scopeallharvests every workspace.Verification
pytest tests/test_harvest_kimi.py— 7 passed.pytest tests/ -k "harvest or source or config or cli") — 450 passed; the 15 failures intest_sleep_config_encoding.pyreproduce on Windowsmainwithout this change (error message embeds a repr-escaped path).dry-run --source kimiharvested 66 sessions from~/.kimi-code/sessionsand ran the full harvest → mine → replay → consolidate → gate cycle with themockbackend.