Cap post-fork setup at 5-minute timeout and surface only failures#123
Merged
Conversation
The post-fork hook previously ran with a 10-minute timeout and logged its full lifecycle (start, success, running) on the worktree card. A successful or still-running setup is routine noise, so only failures are worth showing. - Reduce the post-fork timeout from 10 to 5 minutes; a run exceeding it is treated as a failure. - Add isVisibleCardEvent to hide running/succeeded post-fork events, keeping only failures (genuine failures and timeouts, both Failed) and all events from other sources. - Filter branch events through isVisibleCardEvent in worktreeCard so hasContent and the event log both respect the rule. - Add VisibleCardEventTests covering running/succeeded/failed/timeout post-fork events and non-post-fork events. - Update the worktree-monitor spec to describe the timeout and failure-only surfacing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dcaeba87-e3b1-497e-9042-c6893a513922
There was a problem hiding this comment.
Pull request overview
Caps post-fork setup at five minutes and hides routine lifecycle events from worktree cards.
Changes:
- Reduces the post-fork timeout to five minutes.
- Shows only failed post-fork events.
- Adds visibility tests and updates the specification.
Show a summary per file
| File | Description |
|---|---|
src/Server/GitWorktree.fs |
Reduces the setup timeout. |
src/Client/CardViews.fs |
Filters post-fork card events. |
src/Tests/CardViewsTests.fs |
Tests event visibility rules. |
docs/spec/worktree-monitor.md |
Documents timeout and visibility behavior. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Medium
Add runPostForkWithTimeout so the 5-minute cap can be exercised with a short injectable timeout, and cover it with an integration test that kills a hung post-fork script. Fix the spec to consistently state that only post-fork failures surface on the card. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e17ff922-050e-4530-883e-24722ee29444
# Conflicts: # docs/spec/worktree-monitor.md
0101
enabled auto-merge (squash)
July 17, 2026 13:57
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.
Summary
The post-fork setup hook (
post-fork.ps1/post-fork.sh) previously ran with a 10-minute timeout and logged its full lifecycle — start, still-running, success — on the worktree card. A successful or in-progress setup is routine noise, and a hook that hangs shouldn't block the auto-launch indefinitely.This change caps the hook and shows only what matters:
isVisibleCardEventhides running/succeeded post-fork events and keeps only failures (genuine failures and timeouts, bothFailed). Events from every other source always show.worktreeCardfilters branch events throughisVisibleCardEventso bothhasContentand the event log honor it.docs/spec/worktree-monitor.mdnow documents the 5-minute timeout and failure-only surfacing.Tests
Added
VisibleCardEventTests(Unit/Fast) covering running, succeeded, failed, and timed-out post-fork events plus a non-post-fork event.