agentmemory icon indicating copy to clipboard operation
agentmemory copied to clipboard

revert: remove Codex Stop hook session-end

Open Rex57 opened this issue 6 months ago β€’ 2 comments

Summary

  • Reverts #495 because Codex Stop can fire before the overall conversation is truly finished.
  • Restores the Codex Stop hook to summarize-only behavior.
  • Removes the test that required session-end.mjs to run from Stop.

Why

After testing in Codex, adding session-end.mjs to Stop marks sessions completed too early while later observations can still arrive. A separate SessionEnd hook is not surfaced by Codex /hooks for this plugin, so the safe behavior is to avoid ending sessions from Stop.

Verification

  • npx vitest run test/codex-plugin.test.ts

Refs #493

Summary by CodeRabbit

  • Chores
    • Simplified Stop hook by removing session-end command execution

Review Change Stack

Rex57 avatar May 18 '26 10:05 Rex57

@Rex57 is attempting to deploy a commit to the rohitg00's projects Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar May 18 '26 10:05 vercel[bot]

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 494bd4d4-720d-49d4-a5e5-6c1b3ca47d44

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between caa9f5223e194d5588b3cf2b61469a6cbc56b7de and 8b5312ad6dc47c3dd70e8f293d80a06cb7fa6c91.

πŸ“’ Files selected for processing (2)
  • plugin/hooks/hooks.codex.json
  • test/codex-plugin.test.ts
πŸ’€ Files with no reviewable changes (2)
  • plugin/hooks/hooks.codex.json
  • test/codex-plugin.test.ts

πŸ“ Walkthrough

Walkthrough

This PR removes the scripts/session-end.mjs command from the Stop hook configuration and deletes the test case that verified both stop and session-end commands were present. The Stop hook now only executes scripts/stop.mjs.

Changes

Stop Hook Command Simplification

Layer / File(s) Summary
Stop hook and test update
plugin/hooks/hooks.codex.json, test/codex-plugin.test.ts
The Stop hook removes the session-end.mjs command, and the test validating that command presence is deleted.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • rohitg00/agentmemory#495: This PR directly reverses the changes from #495, which added scripts/session-end.mjs to the Stop hook and asserted it in the test.

Poem

🐰 The session says goodbye, goodbye, No end command needed now, oh my! Simpler hooks hop with glee, Stop script stands alone, you see!

πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title 'revert: remove Codex Stop hook session-end' directly and clearly summarizes the main change: reverting a previous change that added session-end functionality to the Codex Stop hook.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check βœ… Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check βœ… Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • [ ] Create PR with unit tests

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.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar May 18 '26 10:05 coderabbitai[bot]

Merged + shipping in v0.9.20 β€” https://github.com/rohitg00/agentmemory

Thanks @Rex57 for both the original fix and the field-tested revert. Re-opened #493 to track the SessionEnd-shaped solution. #502 follow-up on graph extraction also in the queue.

rohitg00 avatar May 18 '26 18:05 rohitg00