Skip to content

fix(hooks): add timeout to Claude and Gemini hook entries - #1804

Open
ShiraiEd wants to merge 1 commit into
rtk-ai:developfrom
ShiraiEd:fix/hook-timeout
Open

ShiraiEd wants to merge 1 commit into
rtk-ai:developfrom
ShiraiEd:fix/hook-timeout

Conversation

@ShiraiEd

@ShiraiEd ShiraiEd commented May 8, 2026 •

Copy link
Copy Markdown

Summary

Problem

If RTK hangs during a hook call, Claude stalls indefinitely — there is no timeout to bail out. The Copilot hook already had "timeout": 5, but the
Claude Code and Gemini CLI hooks were missing it entirely.

Fixes #218.

Changes

  • Added "timeout": 10 to the Claude Code PreToolUse hook written by rtk init
  • Added "timeout": 10 to the Gemini CLI BeforeTool hook written by rtk init

copilot timeout still 5s

Test plan

Added two tests asserting timeout is 10s: one for the Claude Code hook (in-memory JSON), one for the Gemini hook (file write via TempDir)

  • cargo fmt --all && cargo clippy --all-targets && cargo test
  • Manual testing: rtk <command> output inspected

@rtk-release-bot

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale due to 90 days of inactivity. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. Your contribution is very much appreciated — we're sorry we haven't been able to review it yet.

@rtk-release-bot rtk-release-bot Bot added the stale label Sep 3, 2026
@ShiraiEd

ShiraiEd commented Sep 4, 2026

Copy link
Copy Markdown
Author

bump

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.

Add timeout to hook

1 participant