Skip to content

Cap post-fork setup at 5-minute timeout and surface only failures#123

Merged
0101 merged 3 commits into
mainfrom
post-fork-timeout
Jul 17, 2026
Merged

Cap post-fork setup at 5-minute timeout and surface only failures#123
0101 merged 3 commits into
mainfrom
post-fork-timeout

Conversation

@0101

@0101 0101 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

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:

  • Timeout reduced 10 → 5 minutes. A run that exceeds the cap is treated as a failure rather than blocking indefinitely.
  • Only failures surface on the card. New isVisibleCardEvent hides running/succeeded post-fork events and keeps only failures (genuine failures and timeouts, both Failed). Events from every other source always show.
  • Card content respects the rule. worktreeCard filters branch events through isVisibleCardEvent so both hasContent and the event log honor it.
  • Spec updated. docs/spec/worktree-monitor.md now 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.

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
Copilot AI review requested due to automatic review settings July 17, 2026 13:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread src/Server/GitWorktree.fs
Comment thread docs/spec/worktree-monitor.md Outdated
0101 and others added 2 commits July 17, 2026 15:50
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
0101 enabled auto-merge (squash) July 17, 2026 13:57
@0101
0101 merged commit 395e8f7 into main Jul 17, 2026
1 check 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.

2 participants