fix(plugin): restore bug fixes from #681 and #688 lost during #662 merge#779
fix(plugin): restore bug fixes from #681 and #688 lost during #662 merge#779
Conversation
PR #662 renamed the plugin directory and rewrote index.ts from a stale branch base, silently dropping two merged bug fixes: - #681: share pending clientPromise across dual-context registrations to prevent before_agent_start hook from hanging forever - #688: wrap auto-recall search in withTimeout(5s) to prevent indefinite agent hang when OpenViking search API is slow or unresponsive
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Description
PR #662 renamed the plugin directory from
openclaw-memory-plugintoopenclaw-pluginand rewroteindex.ts, but was based on a stale branch that predated two important bug fixes (#681 and #688). This PR restores those lost fixes, adapted to the current context-engine code.Related Issue
Restores fixes from:
Type of Change
Changes Made
localClientPendingPromisesshared map so that dual-context plugin registrations (gateway + plugins) share the same pending client promise instead of creating independent ones that never resolvestart()claims the pending entry from the map — only the first caller spawns the process;stop()clears the map to prevent stale entries across hot-reloadsfind()+ post-processing +read()) inwithTimeout(5s)to prevent thebefore_prompt_buildhook from blocking the agent indefinitelyTesting
Checklist
Additional Notes
The
PendingClientEntrytype andlocalClientPendingPromisesmap were already present inclient.ts(from #681), but unused —index.tsnever imported them after #662's rewrite. This PR reconnects the wiring.🤖 Generated with Claude Code