Skip to content

stop spawned commands on exit - #62

Merged
dhth merged 1 commit into
mainfrom
kill-spawned-processes-on-exit
Aug 16, 2026
Merged

stop spawned commands on exit#62
dhth merged 1 commit into
mainfrom
kill-spawned-processes-on-exit

Conversation

@dhth

@dhth dhth commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Move external command execution behind an application-scoped executor and propagate Cobra’s context through Bubble Tea and command runs.

When the TUI exits, the executor stops new runs, cancels active direct children, and waits for cleanup. A one-second wait delay prevents inherited output pipes from blocking shutdown; terminating descendant process trees remains out of scope.

Implements #61.

Move external command execution behind an application-scoped executor
and propagate Cobra’s context through Bubble Tea and command runs.

When the TUI exits, the executor stops new runs, cancels active direct
children, and waits for cleanup. A one-second wait delay prevents
inherited output pipes from blocking shutdown; terminating descendant
process trees remains out of scope.
@dhth

dhth commented Aug 16, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e248d2d-1e2d-462f-a9ab-a9200647ea9b

📥 Commits

Reviewing files that changed from the base of the PR and between cc4902b and 192c4da.

📒 Files selected for processing (7)
  • internal/cmd/root.go
  • internal/executor/runner.go
  • internal/ui/cmds.go
  • internal/ui/initial.go
  • internal/ui/model.go
  • internal/ui/ui.go
  • internal/ui/update.go

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Adds a context-aware executor that runs commands with custom environments, wait delays, cancellation, and shutdown handling. Command startup creates and shuts down one executor. The UI receives the command context and executor. Initial, restart, sequential, parallel, and delayed command execution paths use the shared executor.

Merge Risk: ⚪ Minimal · up to 192c4

The change coordinates spawned command shutdown and cancellation without any identified actionable merge-blocking risk; it is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: stopping spawned commands when the application exits.
Description check ✅ Passed The description accurately explains the executor, context propagation, shutdown behavior, delay, scope, and related issue.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dhth
dhth merged commit 84cfab9 into main Aug 16, 2026
11 checks passed
@dhth
dhth deleted the kill-spawned-processes-on-exit branch August 16, 2026 08:56
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.

1 participant