feat: fire session reset hooks for daily and idle resets#61675
feat: fire session reset hooks for daily and idle resets#61675salvormallow wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d004142bd1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Greptile SummaryWires Confidence Score: 5/5Safe to merge — both new hook blocks are correctly guarded, fire-and-forget semantics match existing patterns, and tests cover all key scenarios including no-double-fire on manual resets. All previously flagged issues are resolved. The missing No files require special attention. Greploops — Automatically fix all review issues by running Reviews (2): Last reviewed commit: "feat: fire session reset hooks for daily..." | Re-trigger Greptile |
d004142 to
86ec2f8
Compare
|
Addressed all three review comments in 86ec2f8: @chatgpt-codex-connector P2 — Internal hooks gated behind hookRunner: @greptile-apps P1 — Missing @greptile-apps P2 — Long line: All 34 tests pass. |
86ec2f8 to
6682f77
Compare
6682f77 to
7e627e9
Compare
|
(Updated after rebase onto latest main — the review fixes from the previous comment are now in 7e627e9. Also resolved merge conflict in |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e627e9e55
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
7e627e9 to
fbbf7bb
Compare
|
@chatgpt-codex-connector Fixed in fbbf7bb — now uses the already-resolved |
|
To use Codex here, create a Codex account and connect to github. |
|
CI note: All failures on this PR are pre-existing upstream breakage on
These cascade into the extension shard cancellations. This PR only touches Happy to rebase once main is green again. ready for review whenever you get a chance 🙏 |
|
Amazing work! We need this fix! |
Wire internal hooks and before_reset plugin hook into the lazy staleness path so they fire on daily (4AM) and idle-timeout resets, not just manual /new and /reset commands. Both hooks fire as fire-and-forget to avoid blocking the user's message response (session-memory's LLM slug generation can take up to 15s). commands-core is dynamically imported inside the fire-and-forget block to avoid pulling its heavy dependency tree into session.ts's static imports. Export loadBeforeResetTranscript from commands-core for use by session.ts. Update bundled session-memory hook registration and filter to accept "daily" and "idle" actions. Fixes openclaw#10142, openclaw#31266, openclaw#50891, openclaw#43524 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Codex review: needs real behavior proof before merge. Reviewed June 6, 2026, 12:46 AM ET / 04:46 UTC. Summary PR surface: Source +64, Tests +429, Docs +1. Total +494 across 8 files. Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Review detailsBest possible solution: Retry the Codex review after fixing the execution failure. Do we have a high-confidence way to reproduce the issue? Unclear. The review failed before ClawSweeper could establish a reproduction path. Is this the best way to solve the issue? Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model gpt-5.5, reasoning high; reviewed against 9313471fa579. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +64, Tests +429, Docs +1. Total +494 across 8 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
Summary
before_resetplugin hook only fire for manual/newand/resetcommands, not for daily (4AM) or idle-timeout session resets. This meanssession-memorynever saves on daily/idle resets.initSessionState(), updatesession-memoryregistration and filterexportadded to existing functionsChange Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
initSessionState()firessession_end/session_startplugin hooks for lazy resets but never firestriggerInternalHookorhookRunner.runBeforeReset. These only fire viaemitResetCommandHooks()incommands-core.ts, which is only called for manual/newand/resetcommands.Regression Test Plan (if applicable)
src/auto-reply/reply/session.stale-hooks.test.ts(new),src/hooks/bundled/session-memory/handler.test.ts(extended)action: "daily"/"idle"when session is stale;before_resetplugin hook fires for lazy resets; no double-fire on manual resettriggerInternalHookandhookRunnerto assert dispatch without side-effectssession-hooks-context.test.tscoverssession_end/session_startbut not internal hooks orbefore_resetUser-visible / Behavior Changes
session-memorynow saves session summaries on daily (4AM) and idle-timeout resets, not just manual/newand/reset. Pluginbefore_resethook now fires for lazy resets, giving plugins pre-archive transcript access.Diagram (if applicable)
Security Impact (required)
Repro + Verification
Environment
Steps
Expected
session-memorysaves a summary of the previous sessionbefore_resetplugin hook fires withreason: "daily"and transcript messagesActual (before this PR)
session-memorydoes not fire — no summary savedbefore_resetplugin hook does not fireEvidence
Human Verification (required)
Review Conversations
Compatibility / Migration
Risks and Mitigations
before_resetreceives the post-archivesessionFilepath (afterrenameSync), not the original path.loadBeforeResetTranscripthandles ENOENT by scanning for the latest.reset.*archived sibling.AI Disclosure
🤖 AI-assisted with Claude Code
cc @vincentkoc (hooks/plugins CODEOWNER)