Problem
packages/opencode/src/core/tasks.ts (212 lines) has ZERO tests. This is a critical module for async tool execution.
Required Tests
- Task lifecycle (start → running → completed)
- Error handling in background tasks
- Session cancellation
- Concurrent limit enforcement
- Auto-injection of results into context
- Cleanup/garbage collection
Files
- Create:
packages/opencode/test/core/tasks.test.ts
Coverage Target
80%+ line coverage for tasks.ts
Branch
claude/simplify-agentic-loop-2jRSP