Feat/add pending background processes#697
Merged
shehab299 merged 11 commits intoMay 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds visibility into pending/running background tasks during quit, and plumbs a shared TaskManagerHandle so the TUI can query task status directly (instead of being blind to subagent/background activity).
Changes:
- Thread a shared
TaskManagerHandlefrom CLI interactive mode → MCP server + TUI, and allow MCP server to accept an externally-created handle. - On first Ctrl+C in the TUI, asynchronously query tasks and update the “press Ctrl+C again” hint with the number of running/pending/paused background tasks.
- Extend TUI event types/handlers to carry and store the background-task count.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tui/src/services/hint_helper.rs | Renders a quit hint that includes background task count when available. |
| tui/src/services/handlers/mod.rs | Handles the new input event to update running_background_tasks; updates test state builder. |
| tui/src/services/handlers/misc.rs | On first Ctrl+C, spawns an async query to count active background tasks and sends an event back to the UI loop. |
| tui/src/event_loop.rs | Extends run_tui signature to accept a shared TaskManagerHandle and stores it in AppState. |
| tui/src/app/events.rs | Adds RunningBackgroundTasksCount input event and marks it as a backend/non-interceptable event. |
| tui/src/app.rs | Adds task_manager_handle and running_background_tasks to AppState and AppStateOptions. |
| libs/mcp/server/src/lib.rs | Adds optional task_manager_handle to server config; uses provided handle or creates its own TaskManager. |
| cli/src/commands/mcp/server.rs | Populates new MCP server config field with None for standalone server. |
| cli/src/commands/autopilot/mod.rs | Uses struct update syntax to pick up new McpInitConfig fields. |
| cli/src/commands/agent/run/mode_interactive.rs | Creates and runs a shared TaskManager; passes handle to both TUI and MCP server init. |
| cli/src/commands/agent/run/mode_async.rs | Uses struct update syntax to pick up new McpInitConfig fields. |
| cli/src/commands/agent/run/mcp_init.rs | Adds task_manager_handle to init config and forwards it into MCPServerConfig. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
ahmedhesham6
reviewed
May 6, 2026
ahmedhesham6
reviewed
May 6, 2026
ahmedhesham6
approved these changes
May 18, 2026
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.
No description provided.