Skip to content

fix(workbuddy): extend prompt hook timeout - #1660

Merged
Teingi merged 1 commit into
oceanbase:masterfrom
AlexStocks:codex/workbuddy-hook-timeout
Sep 19, 2026
Merged

Teingi merged 1 commit into
oceanbase:masterfrom
AlexStocks:codex/workbuddy-hook-timeout

Conversation

@AlexStocks

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Closes #1659.

Rationale for this change

The WorkBuddy integration currently registers the PowerContext UserPromptSubmit hook 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?

  • Raises the WorkBuddy UserPromptSubmit hook timeout from 10 seconds to 30 seconds in the CLI installer.
  • Updates the WorkBuddy hook template to match the installer.
  • Updates WorkBuddy integration docs in English, Chinese, and the integration README.
  • Updates WorkBuddy CLI tests so installed and refreshed hooks assert the new timeout.

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.py
  • uv run pytest tests/test_cli_workbuddy.py tests/test_integration_manifest.py -q
  • git diff --check

AI usage statement

Used OpenAI Codex to investigate the WorkBuddy hook timeout, prepare the patch, update tests/docs, and run the validation commands above.

@Teingi Teingi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Teingi
Teingi merged commit fa581ee into oceanbase:master Sep 19, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: WorkBuddy prompt hook can be killed before fail-open completes

2 participants