Skip to content

Add Codex Desktop transcript harvesting - #48

Closed
Kostarev Kirill (Kirchberg) wants to merge 1 commit into
microsoft:mainfrom
Kirchberg:codex/codex-desktop-harvest
Closed

Kostarev Kirill (Kirchberg) wants to merge 1 commit into
microsoft:mainfrom
Kirchberg:codex/codex-desktop-harvest

Conversation

@Kirchberg

@Kirchberg Kostarev Kirill (Kirchberg) commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR adds native Codex Desktop transcript harvesting to SkillOpt-Sleep

Previously, the Codex integration could use Codex as the replay/optimization backend, but the sleep-cycle harvester still depended on Claude Code-style transcripts. This meant Codex Desktop users did not have a direct path for mining their real archived sessions

This change adds a Codex Desktop source that reads ~/.codex/archived_sessions, normalizes user/assistant turns into SessionDigest records, and avoids copying developer/system context, tool arguments, or raw tool outputs

Changes

  • Add skillopt_sleep.harvest_codex for Codex Desktop archived session JSONL files
  • Add source routing via --source claude|codex|auto
  • Add --codex-home for non-default Codex home directories
  • Route run, dry-run, and harvest through the selected transcript source
  • Update Codex plugin documentation with --source codex examples
  • Add tests for Codex archive harvesting, sanitization, project filtering, and CLI source selection

Notes

--source codex controls where past sessions are harvested from

--backend codex still controls whether Codex is used as the replay/optimization backend and may spend the user's Codex budget

Related to #45, but does not fully resolve the broader Codex plugin UX feedback around deprecated custom prompts and skill-first setup

Verification

  • python -m pytest tests
  • ruff check --no-cache skillopt_sleep/harvest_codex.py skillopt_sleep/harvest_sources.py skillopt_sleep/__main__.py skillopt_sleep/config.py skillopt_sleep/cycle.py skillopt_sleep/types.py skillopt_sleep/memory.py tests/test_sleep_engine.py
  • python -m skillopt_sleep dry-run --project /Users/kirchberg/Yoshi --source codex --codex-home /Users/kirchberg/.codex --backend mock --lookback-hours 8760 --json

@Kirchberg

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Zisu Huang (Huangzisu) pushed a commit that referenced this pull request Jun 15, 2026
Add Codex Desktop transcript harvesting
@Yif-Yang

Copy link
Copy Markdown
Contributor

Merged manually after rebasing onto main (post #49 merge). All conflicts resolved — kept main's expanded plugin docs, integrated PR's --source codex feature into SKILL.md. 101 tests pass (including 2 new Codex harvest tests). Thank you Kostarev Kirill (@Kirchberg)!

Yifan Yang (Yif-Yang) added a commit to Yif-Yang/SkillOpt that referenced this pull request Jun 15, 2026
…g branch

Pulls microsoft/main after the merged community PRs: OpenClaw plugin shell
(microsoft#59), Codex Desktop transcript harvesting + skill-first integration (microsoft#48/microsoft#49),
shared-default reflect refactor (microsoft#44), and benchmark-guide doc fixes (microsoft#43).

Conflict resolution: shared plugin/docs/engine files (README, plugins/codex/*,
backend.py, docs/sleep/*) taken from upstream — upstream already contains my
pushed plugin (86bad36) plus the community additions, so this loses nothing of
mine. .gitignore unioned. Codex prompt files removed to follow upstream's
skill-first design. My local-only work (blog/, docs/sleep experiments, v2
research harnesses) is untouched; engine fixes (sample_id dream diversity,
guarded imports, retry) preserved. 104/104 tests pass.

Co-Authored-By: Claude Opus 4 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants