fix(plugin): add timeout protection to getClient() in before_prompt_build hook#749
Open
Meskjei wants to merge 1 commit intovolcengine:mainfrom
Open
fix(plugin): add timeout protection to getClient() in before_prompt_build hook#749Meskjei wants to merge 1 commit intovolcengine:mainfrom
Meskjei wants to merge 1 commit intovolcengine:mainfrom
Conversation
…uild hook - Import withTimeout from process-manager.js - Wrap getClient() call with 5-second timeout to prevent indefinite blocking - Gracefully handle timeout by logging warning and skipping recall - Fixes issue where agent would hang if OpenViking service wasn't ready yet Related: volcengine#673 volcengine#748
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.
Problem
The
before_prompt_buildhook callsawait getClient()without timeout protection. If the OpenViking client hasn't finished initializing when the hook is triggered, the agent will hang indefinitely waiting for the client Promise to resolve.This happens because:
before_prompt_buildhookstart()function completes OpenViking server startupawait getClient()getClient()waits forclientPromiseto resolveclientPromiseonly resolves afterstart()finishes starting the OpenViking servicestart()can't finishSolution
Wrap
getClient()call withwithTimeout()(5 seconds):Testing
Tested locally with OpenClaw + OpenViking plugin:
Related Issues
auto-recalltimeout but not the initialgetClient()call in hook)