Skip to content

Conversation

@avillagran
Copy link

@avillagran avillagran commented Jan 20, 2026

  • Add Background Tasks modal (ctrl+p > "Background tasks")
  • Add [bg] button to migrate running processes to background
  • Add [kill] button to terminate running processes
  • Support [bg]/[kill] for shell commands (! prefix)
  • Add TaskManager.adopt() for process migration
  • Add foreground process registry for tracking
  • Optimize migration latency with fire-and-forget persistence
  • Add 17 tests for foreground process management

Fixes: #9714

Implement a system for running and managing background processes that
persist across sessions:

- TaskManager core with create/list/get/kill/read/tail/input operations
- Persistence layer saving state to .opencode/tasks/{taskId}.json
- Bus events for task lifecycle (created, output, completed, killed)
- Bash tool now supports run_in_background parameter
- RPC handlers for task management from TUI
- Comprehensive test suite (29 tests)

Background tasks can be reconnected after session restart by checking
if the process (by PID) is still running.
New tool allows LLM to:
- List all background tasks
- Check task status
- Read full or partial output
- Search for patterns in task logs

Resolves task identifiers by ID, "last" keyword, or description match.
- Add Background Tasks modal (ctrl+p > "Background tasks")
- Add [bg] button to migrate running processes to background
- Add [kill] button to terminate running processes
- Support [bg]/[kill] for shell commands (! prefix)
- Add TaskManager.adopt() for process migration
- Add foreground process registry for tracking
- Clean up debug logs (use Log utility instead of console)
- Optimize migration latency with fire-and-forget persistence
- Add 17 tests for foreground process management
@github-actions
Copy link
Contributor

Hey! Your PR title Feature/background task manager doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@avillagran avillagran changed the title Feature/background task manager feat(tui): Feature/background task manager Jan 20, 2026
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@avillagran avillagran changed the title feat(tui): Feature/background task manager feat(opencode): Feature/background task manager Jan 20, 2026
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.

[FEATURE]: Background Tasks Manager

1 participant