This repository was archived by the owner on Apr 2, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
fix: reduce stop hook API timeout from 10m to 90s #567
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 90s cap only applies to the fetch phase, not the whole Stop hook.
Right now the command can still spend up to 5s in
project.Detect, 15s inGetWorkingMemory, and then another 90s here, so the real wall-clock cap is still closer to ~110s. If the PR goal is a true end-to-end Stop-hook limit, give the whole run path a parent deadline and derive these sub-contexts from it.Possible shape of the fix
func runHandler(cmd *cobra.Command, args []string) error { + runCtx, runCancel := context.WithTimeout(context.Background(), 90*time.Second) + defer runCancel() + ... - gitCtx, gitCancel := context.WithTimeout(context.Background(), 5*time.Second) + gitCtx, gitCancel := context.WithTimeout(runCtx, 5*time.Second) defer gitCancel() ... - wmCtx, wmCancel := context.WithTimeout(context.Background(), 15*time.Second) + wmCtx, wmCancel := context.WithTimeout(runCtx, 15*time.Second) defer wmCancel() ... - ctx, cancel := context.WithTimeout(context.Background(), 90*time.Second) + ctx, cancel := context.WithTimeout(runCtx, 90*time.Second) defer cancel()You'd want to thread that same parent context into
runWithoutCachetoo.Also applies to: 475-479
🤖 Prompt for AI Agents