fix: preserve plugin hook and tool closure state#78075
fix: preserve plugin hook and tool closure state#78075bryce-d-greybeard wants to merge 1 commit into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep open: the linked issue is still open and current main has not implemented a complete closure-state fix. This branch is a useful candidate, but it needs a rebase, real behavior proof, and live-registry-source alignment before merge. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main can return cached descriptor-backed tools before the live registry path whose hooks own closure state. I did not run a live mem0 gateway reproduction in this read-only review. Is this the best way to solve the issue? No as written. The fix is plausible but too narrow because cached-tool bypass should align with the same live registry sources used by hook dispatch, not only active and channel registries. Security review: Security review cleared: The diff is limited to plugin resolver logic and a colocated test, with no dependency, workflow, secret, permission, package, lockfile, or supply-chain surface changed. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 010b61746379. |
|
Heads up: this PR needs to be updated against current |
|
The changes look good overall. Consider adding a test case to cover this scenario if possible. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
@bryce-d-greybeard thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
Summary
Fixes plugin tool resolution so cached descriptor wrappers do not bypass an already-live plugin registry that owns both hooks and tools for the same plugin. That keeps hook handlers and tool factories on the same
register()closure when a plugin uses closure state acrossbefore_prompt_buildand a tool likememory_add.Changes
Testing
PATH="/tmp/openclaw-pnpm-shim:$PATH" pnpm vitest run src/plugins/tools.optional.test.ts— passed, 59 tests.git diff --check— passed.PATH="/tmp/openclaw-pnpm-shim:$PATH" node scripts/check-changed.mjs— all gates passed through final pairing-account guard; process was SIGKILLed at final exit on this host. StandalonePATH="/tmp/openclaw-pnpm-shim:$PATH" node scripts/check-pairing-account-scope.mjspassed.Fixes #77822