Release Codex lifecycle hooks 0.3.6 - #14
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Summary by QodoRelease native Codex lifecycle hooks in plugin 0.3.6
AI Description
Diagram
High-Level Assessment
Files changed (16)
|
Code Review by Qodo
1. Lifecycle validation never runs in CI
|
| ROOT = Path(__file__).resolve().parents[1] | ||
| LIFECYCLE_EVENTS = {"SessionStart", "SubagentStart", "Stop", "SubagentStop"} | ||
|
|
||
| def load_json(path: Path) -> dict[str, Any]: |
There was a problem hiding this comment.
1. Lifecycle validation never runs in ci 🐞 Bug ☼ Reliability
load_json annotates its return type with Any, but scripts/validate-lifecycle.py neither imports it from typing nor postpones annotation evaluation, so Python raises NameError while defining the function. Every package validation run reaches this script through validate-plugin.sh, so CI stops before lifecycle configuration, packaged-hook forwarding, or other lifecycle assertions execute.
Agent Prompt
## Issue description
The lifecycle validator references `Any` in a runtime-evaluated return annotation without importing it, causing an immediate `NameError` during module initialization.
## Issue Context
`scripts/validate-plugin.sh` always executes this validator as part of the repository's package validation workflow, so CI fails before lifecycle configuration, packaged-hook forwarding, or other lifecycle assertions run. Import `Any` from `typing`, or postpone annotation evaluation and use an available type.
## Fix Focus Areas
- scripts/validate-lifecycle.py[3-8]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if [ -f .codex/hooks.json ] && { | ||
| grep -Fq 'Tree Ring Memory managed lifecycle v2"' .codex/hooks.json || | ||
| grep -Fq 'Tree Ring Memory managed lifecycle v3"' .codex/hooks.json || | ||
| grep -Fq 'Tree Ring Memory managed lifecycle v4"' .codex/hooks.json | ||
| }; then | ||
| exit 0 |
There was a problem hiding this comment.
2. Projects can lose automatic memory checks 🐞 Bug ≡ Correctness
codex-hook.sh treats any occurrence of a managed-lifecycle marker string in .codex/hooks.json as proof that an active managed hook owns the events. A project configuration that merely includes that text in an unrelated description or value makes the marketplace hook exit before invoking the CLI, leaving recall and stop checkpoints unavailable.
Agent Prompt
## Issue description
The marketplace wrapper disables itself based on an unstructured substring match anywhere in `.codex/hooks.json`, rather than confirming that the managed lifecycle definition is present and owns the relevant hook events.
## Issue Context
The wrapper exits before calling the lifecycle CLI. Documentation says this stand-down behavior is intended only when project activation installed the managed lifecycle definition.
## Fix Focus Areas
- hooks/codex-hook.sh[13-18]
- scripts/validate-lifecycle.py[112-147]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| "privacyPolicyURL": "https://github.com/TerminallyLazy/Tree-Ring-Memory/blob/main/plugins/tree-ring-memory/PRIVACY.md", | ||
| "termsOfServiceURL": "https://github.com/TerminallyLazy/Tree-Ring-Memory/blob/main/plugins/tree-ring-memory/TERMS.md", |
There was a problem hiding this comment.
3. Users reach incorrect legal pages 🐞 Bug ≡ Correctness
The changed plugin manifest sends privacy and terms users to a plugins/tree-ring-memory path in the separate framework repository, while the package's published submission identifies the plugin repository's root legal documents. The skills-only manifest duplicates those legal URLs and additionally points its repository field at the framework rather than the published plugin source, so both distribution forms expose inconsistent package provenance and policy links.
Agent Prompt
## Issue description
The repository plugin manifest now points legal-policy links at a different repository path than the source and legal documents declared for this package. The separately generated skills-only manifest repeats these policy URLs and declares the framework repository as its package source.
## Issue Context
The submission material identifies the plugin repository and root-level privacy and terms documents as the published locations. Keep the repository and policy metadata consistent across both manifest variants.
## Fix Focus Areas
- .codex-plugin/plugin.json[38-39]
- packaging/codex-skills-only/.codex-plugin/plugin.json[9-10]
- packaging/codex-skills-only/.codex-plugin/plugin.json[36-38]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Ship native SessionStart/SubagentStart recall and Stop/SubagentStop capture checkpoints in the Git marketplace package. Startup recall now uses CLI 0.15.7 for cross-session project and agent visibility, bounded context, and project-local executable resolution. Managed project hooks take precedence to avoid duplicate recall and checkpoints.
Codex package 0.3.6 includes a root marketplace entry and hook definitions accepted by Codex 0.151. Public-directory ZIPs remain an explicit skills-only build with a distinct manifest; they do not promise automatic hooks.
Validation: package and lifecycle forwarding checks pass, and the real CLI smoke passes. CI installs the checksum-pinned 0.15.7 Linux release.
High-level PR Summary
This release ships version 0.3.6 of the Tree Ring Memory Codex plugin, introducing native lifecycle hooks for automatic session-start recall and stop-event memory checkpoints. The plugin now registers
SessionStart,SubagentStart,Stop, andSubagentStophooks that forward lifecycle events to the Tree Ring Memory CLI (0.15.7). Key features include project-local executable resolution, bounded context loading, agent-mediated checkpointing at stop events, and managed-hook ownership detection to prevent duplicate invocations. The package adds a marketplace entry for Git-based distribution while maintaining a separate skills-only build for directory uploads that excludes hooks.⏱️ Estimated Review Time: 15-30 minutes
💡 Review Order Suggestion
.codex-plugin/plugin.jsonhooks/codex-hooks.jsonhooks/codex-hook.shpackaging/codex-skills-only/.codex-plugin/plugin.jsonpackaging/build-codex-skills-only.py.agents/plugins/marketplace.json.github/workflows/validate.ymlscripts/validate-lifecycle.pyscripts/validate-plugin.shscripts/smoke_v015.shskills/tree-ring-memory/SKILL.mdREADME.mdPRIVACY.mdTERMS.mdSECURITY.mdSUBMISSION.md