Skip to content

feat(select): add 500ms timeout for git commands to improve TUI responsiveness - #484

Merged
max-sixty merged 1 commit into
mainfrom
461-timeout
Jan 9, 2026
Merged

max-sixty merged 1 commit into
mainfrom
461-timeout

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Summary

  • Add thread-local command timeout to shell_exec::run() for killing slow git commands
  • wt select uses 500ms timeout to show TUI faster on large repos with many branches
  • wt list continues to wait for all data (no timeout)

Addresses performance issues on repos with 100+ branches where git operations (merge-tree, rev-list, diff) can take 400-1800ms each.

Architecture: Thread-local timeout set per-worker in Rayon's thread pool. Repository and TaskContext stay clean - timeout is purely a runner concern.

Test plan

  • Unit tests for timeout behavior (test_run_with_timeout_*)
  • All existing tests pass (757 integration, 413 unit)
  • Manual test on large repo with many branches

Closes #461

🤖 Generated with Claude Code

…nsiveness

On large repos with many branches, `wt select` was slow because git operations
(merge-tree, rev-list, diff) can take 400-1800ms each. This adds a thread-local
command timeout that kills git commands exceeding 500ms.

Architecture:
- Thread-local `COMMAND_TIMEOUT` in shell_exec.rs, checked by `run()`
- `set_command_timeout()` called per-worker in Rayon's thread pool
- Repository and TaskContext stay clean (no timeout fields)
- `wt list` passes None (no timeout), `wt select` passes 500ms

Closes #461

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit bb0fde7 into main Jan 9, 2026
@max-sixty
max-sixty deleted the 461-timeout branch January 9, 2026 06:20
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.

wt select takes 15s

1 participant