Repository navigation
Avoid retaining an unused OpenCode database worker - #26113
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The change appears mergeable after normal checks; no outstanding issue is established. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
ELI5
Orca no longer keeps an unused database worker running when OpenCode has never created its database.
What Changed
The binder checks once at startup and every minute. Previously, checking an absent database started a worker; each minute reset its two-minute idle expiry. An asynchronous file probe now returns the existing empty result before constructing the worker for ENOENT or ENOTDIR.
Why
A bundled production-worker measurement retained 22.7–27.2 MB of resident memory and took 33.6–37.2 ms to start just to return an empty result. This removes the allocation rather than changing idle timeouts or caching absence. Every call checks again, so installing OpenCode later is still detected. Other errors and deletion after the probe keep the existing worker handling.
Linked Issue
None; internal performance audit.
Visual Proof
N/A — background worker admission changes; displayed sessions and interaction behavior stay the same.
Testing
pnpm tcand changed-code quality passed; targeted formatting/lint passed.Review
The existing reader remains authoritative. No wire, SQLite query, provider routing, folder/worktree lookup or agent-status precedence changes. Each host checks its own OpenCode path; no client fallback or new cache.
Agent skill upstream boundary
Checklist