fix(workbuddy): extend prompt hook timeout - #1660
Merged
Merged
Conversation
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.
Which issue or RFC does this PR close?
Closes #1659.
Rationale for this change
The WorkBuddy integration currently registers the PowerContext
UserPromptSubmithook with a 10-second host timeout. In real desktop sessions, cold startup, degraded local services, or scope resolution overhead can push the hook past that outer timeout even though the hook itself has a smaller HTTP budget and is designed to fail open.A longer outer timeout gives the hook process enough room to return its fail-open response instead of letting WorkBuddy kill the hook and block the prompt.
What changes are included in this PR?
UserPromptSubmithook timeout from 10 seconds to 30 seconds in the CLI installer.Are there any user-facing changes?
Yes. New or refreshed WorkBuddy installations now register the PowerContext prompt hook with a 30-second outer timeout. The hook's internal HTTP request timeout and shared HTTP budget remain unchanged, so PowerContext HTTP calls still fail open under their bounded budget.
There are no public API, persisted format, or MCP contract changes.
How was this change tested?
rg -n 'WORKBUDDY_HOOK_TIMEOUT = 10|"timeout": 10|Hook timeout \(10 s\)|Hook 超时(10 秒)|hook\["timeout"\] == 10' src/powercontext/cli/workbuddy.py integrations/workbuddy docs/en/docs/integrations/workbuddy.md docs/zh/docs/integrations/workbuddy.md tests/test_cli_workbuddy.pyuv run pytest tests/test_cli_workbuddy.py tests/test_integration_manifest.py -qgit diff --checkAI usage statement
Used OpenAI Codex to investigate the WorkBuddy hook timeout, prepare the patch, update tests/docs, and run the validation commands above.