- Replace 'Path | None' union syntax with 'Optional[Path]' (typing import)
so continuity_doctor.py works on Python 3.6+
- Remove message-count guard in agent_end hook that blocked state writes
when realUserMsgs.length < 2; agents can now update CURRENT_STATE.md
regardless of conversation length
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Short conversations (< 2 real user messages) no longer overwrite
existing meaningful state. This prevents the "recovery death spiral"
where:
1. Secret told → state saved ✅
2. /new → state injected → model ignores it → "I don't remember"
3. agent_end overwrites good state with "I don't remember" ❌
4. All subsequent recoveries fail permanently
Now step 3 is blocked: a 1-message "what was my secret?" conversation
won't overwrite the previously saved secret.
Also strips channel metadata and /new-style short commands from
the real message count.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The agent_end hook was skipping state extraction when CURRENT_STATE.md
already contained meaningful content. This meant once a state was written,
subsequent conversations never updated it — the next /new would always
recover stale data.
Now: every session end overwrites CURRENT_STATE.md with the latest
conversation state. Previous state is archived to STATE_ARCHIVE_<ts>.md.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Hook callbacks now get workspace from _ctx.workspaceDir (the hook
context parameter) instead of api.runtime.workspaceDir which is
undefined in gateway mode. This was the root cause of the plugin
silently doing nothing on all remote/gateway deployments.
- extractStateFromMessages now strips Telegram/Discord channel
metadata ("Conversation info (untrusted metadata)") from user
messages before saving to CURRENT_STATE.md, preventing garbage
data in the Objective field.
Tested on: macOS local (GPT-5.4), Oracle Cloud (MiniMax M2.5)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace prompt-based skill approach with OpenClaw lifecycle hooks
(before_agent_start, agent_end, before_compaction, before_reset).
State injection now happens automatically at the hook level,
making it model-agnostic and reliable across all providers.
- Add index.js with 5 lifecycle hooks
- Add openclaw.plugin.json manifest
- Rewrite post-install.sh to handle plugin installation
- Update README with plugin architecture docs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>