Repository navigation
fix(openclaw): capture inbound identity on message_received so Goals can start - #5530
Merged
Merged
Conversation
…can start OpenClaw refuses to start or resume a Goal while any plugin registers before_dispatch (it cannot replay that hook after a restart), so enabling Hindsight blocked Goals with "Goal start or resume requires the built-in OpenClaw runtime...". The hook only cached the sender and dispatch surface. message_received carries the same fields and fires earlier on the same inbound path, and is not on OpenClaw's restart-unsafe list. The new test fails if the plugin registers any of OpenClaw's Goal-unsafe hooks. Closes #5177
…ok integration tests
This was referenced Oct 14, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5177.
Bug: OpenClaw refuses to start or resume a Goal while any plugin registers
before_dispatch, because it can't replay that hook after a restart (src/plugins/restart-recovery-hook-safety.ts). With Hindsight enabled, Goal start failed with "Goal start or resume requires the built-in OpenClaw runtime and an idle local session with recoverable history".Fix: our
before_dispatchonly cached the sender and dispatch surface per session.message_receivedcarries the same fields (ctx.channelIdis the surface,senderId,sessionKey), fires earlier on the same inbound path, and is not on OpenClaw's restart-unsafe list. The handler body is unchanged apart from reading the surface fromctx.channelId.Test:
goal-safe-hooks.test.tsfails if the plugin registers any of OpenClaw's four Goal-unsafe hooks. It fails onmain.Verified on real OpenClaw 2026.10.2 (built-in runtime, local Hindsight API), Goal start via
chat.sendwith asession-goal-startintent:A probe confirmed
message_receivedfires beforebefore_dispatchwith the same channel, sender and session, and the debug log shows the identity cached from it (webchat/webchat sender=cli).