{"id":50308065,"url":"https://github.com/huahuadeliaoliao/codex-session-compact-collapse","last_synced_at":"2026-05-28T18:01:44.731Z","repository":{"id":353483122,"uuid":"1211343652","full_name":"huahuadeliaoliao/codex-session-compact-collapse","owner":"huahuadeliaoliao","description":"Codex-derived source release for an opt-in session compact route that preserves durable handoff state across repeated compactions.","archived":false,"fork":false,"pushed_at":"2026-04-24T03:59:20.000Z","size":9218,"stargazers_count":1,"open_issues_count":12,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-24T05:34:34.918Z","etag":null,"topics":["agent-memory","codex","compact-collapse","context-compaction","llm","long-running-agents","rust","session-compaction"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huahuadeliaoliao.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":"docs/CLA.md"}},"created_at":"2026-04-15T09:49:13.000Z","updated_at":"2026-04-24T03:55:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/huahuadeliaoliao/codex-session-compact-collapse","commit_stats":null,"previous_names":["huahuadeliaoliao/codex-session-compact-collapse"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/huahuadeliaoliao/codex-session-compact-collapse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huahuadeliaoliao%2Fcodex-session-compact-collapse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huahuadeliaoliao%2Fcodex-session-compact-collapse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huahuadeliaoliao%2Fcodex-session-compact-collapse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huahuadeliaoliao%2Fcodex-session-compact-collapse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huahuadeliaoliao","download_url":"https://codeload.github.com/huahuadeliaoliao/codex-session-compact-collapse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huahuadeliaoliao%2Fcodex-session-compact-collapse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33619972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-memory","codex","compact-collapse","context-compaction","llm","long-running-agents","rust","session-compaction"],"created_at":"2026-05-28T18:01:44.400Z","updated_at":"2026-05-28T18:01:44.725Z","avatar_url":"https://github.com/huahuadeliaoliao.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Codex Session Compact Collapse\n\nThis repository is a Codex-derived experimental source release for session-level\ncompact-collapse. It is based on OpenAI Codex `rust-v0.124.0` and adds an\nopt-in compaction route designed for long-running coding sessions.\n\nThe goal is durable continuity after repeated `/compact` or auto-compaction\nevents: instead of producing a one-off handoff summary, the session route asks\nthe model to maintain a stable `\u003csession_compact_state\u003e` block with active\nmemory, inactive changes, current handoff, and evidence pointers.\n\n\u003e [!WARNING]\n\u003e This is an independent derivative of the open-source OpenAI Codex project.\n\u003e It is not an official OpenAI release.\n\n## What Changed\n\n- Added `compact_strategy = \"session\"` as an explicit opt-in route.\n- Routed manual `/compact` and auto compact through the same selector.\n- Ensured the session strategy wins before provider-based remote compaction.\n- Added a dedicated session-compact prompt contract under\n  `codex-rs/core/templates/session_compact/prompt.md`.\n- Preserved continuity through `replacement_history` while keeping a bounded\n  recent structured frontier.\n- Added sidecar metadata for recent user images without replaying old images\n  into later prompts.\n- Added docs and benchmark harness material for repeated compact recovery\n  checks.\n\nDefault Codex behavior remains unchanged unless the session strategy is\nexplicitly enabled.\n\n## Enable It\n\nBuild from source using the existing Codex build flow:\n\n- [Installing and building](./docs/install.md)\n- [Configuration docs](./docs/config.md)\n- [Contributing](./docs/contributing.md)\n\nThen add this to `~/.codex/config.toml`:\n\n```toml\ncompact_strategy = \"session\"\n```\n\nWith this setting, both manual `/compact` and automatic compaction use the\nsession route. Without it, Codex keeps the upstream default compact behavior.\n\n## Design Notes\n\n- [Active contract](./docs/session-compact-active-contract.md)\n- [Design harness](./docs/session-compact-design-harness.md)\n- [RCR benchmark notes](./docs/session-compact-rcr-benchmark.md)\n- [Staged orchestration notes](./docs/session-compact-staged-orchestration.md)\n\nThe benchmark runner is available at:\n\n```shell\npython3 scripts/session_compact_rcr_benchmark.py --help\n```\n\nThe included benchmark manifest is intentionally small and source-reviewable.\nPrivate copied-session artifacts and local result journals are not included.\n\n## Upstream Lineage\n\nThis repository is derived from the open-source\n[`openai/codex`](https://github.com/openai/codex) codebase and remains under the\nsame Apache-2.0 licensing terms for upstream material.\n\nSee [DERIVATION.md](./DERIVATION.md) for source lineage and public-release\nscope.\n\n## License\n\nThis repository includes upstream Codex material under the\n[Apache-2.0 License](./LICENSE). Additional attribution notices remain in\n[NOTICE](./NOTICE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuahuadeliaoliao%2Fcodex-session-compact-collapse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuahuadeliaoliao%2Fcodex-session-compact-collapse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuahuadeliaoliao%2Fcodex-session-compact-collapse/lists"}