-
Notifications
You must be signed in to change notification settings - Fork 7.2k
feat(opencode): Feature/background task manager #9681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
feat(opencode): Feature/background task manager #9681
Conversation
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
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: No duplicate PRs found |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Fixes: #9714