Repository navigation
Conversation
The session-file watcher derived its directory from getAgentDir() (~/.omp/agent/sessions), while every other session consumer uses getSessionsDir(), which honors the XDG layout ($XDG_DATA_HOME/omp/sessions when the opt-in exists). Under XDG the watcher therefore watched a directory the lister never reads: external session changes (terminal omp, TUI, second instance) never produced a sessions-changed notification, and when the legacy directory did not exist the watcher retried the same wrong path every 5s forever. Verified by reproduction: with a fake HOME/XDG pair, getSessionsDir() pointed at the XDG sessions dir while the old watcher path did not, an appended XDG session line produced zero notifications, and the default-layout control produced one. One-line fix plus a regression guard.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 57 minutes. View limit details
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 |
Code Review Roast 🔥Verdict: No Issues Found | Recommendation: Merge Oh wait, this PR is actually clean. I need to sit down. I had my flamethrower warmed up and everything. 📊 Overall: Like finding a unicorn in production — I didn't think clean PRs existed anymore, but here we are. Files Reviewed (2 files)
Reviewed by free · Input: 39.7K · Output: 1K · Cached: 75.7K |
|
The Bun server/daemon architecture has landed on |
andrebrait
left a comment
There was a problem hiding this comment.
Thank you for fixing the XDG session-watcher mismatch. Maintainer triage at 588ffbdd561e63e11f840a3ffdf7864264c5645c: the production change correctly reuses getSessionsDir() instead of deriving a different directory from getAgentDir(). This remains useful on current main.
The added lib/session-watcher.test.mjs:5-13 only asserts source spelling, so it would pass if the watcher never delivered an event. Please replace that with a behavioral test using an isolated XDG sessions root: create/change a session there and observe the subscriber notification. That protects the reported regression without pinning an implementation.
Recommendation: prioritize this small correctness fix, with a behavioral regression check. Static review of the complete diff; no branch test suite or live filesystem-watcher probe was run here. This is triage, not merge approval.
Port the selected upstream changes onto main 51d3c19 while retaining its Bun server, shared host ownership, durable outbox, and default transcript. Correct integration and Windows compatibility defects exposed by runtime verification; do not import failing-check PRs or deferred folder uploads. Reviewed source heads: ompweb-dev#296 7df8767 ompweb-dev#296 ompweb-dev#297 20af76d ompweb-dev#297 ompweb-dev#298 cdae97a ompweb-dev#298 ompweb-dev#303 588ffbd ompweb-dev#303 ompweb-dev#309 ec97f9e ompweb-dev#309 ompweb-dev#320 7bf8948 ompweb-dev#320 ompweb-dev#321 550d302 ompweb-dev#321 ompweb-dev#334 46dabb4 ompweb-dev#334 ompweb-dev#335 8edc916 ompweb-dev#335 ompweb-dev#338 72fc0a3 ompweb-dev#338 ompweb-dev#340 ea67136 ompweb-dev#340 ompweb-dev#343 645044d ompweb-dev#343 ompweb-dev#349 ed5e053 ompweb-dev#349 ompweb-dev#374 38f93f3 ompweb-dev#374 ompweb-dev#407 20600a7 ompweb-dev#407 ompweb-dev#410 3c210ff ompweb-dev#410 ompweb-dev#411 a99f8bb ompweb-dev#411 ompweb-dev#414 34a33d7 ompweb-dev#414 ompweb-dev#416 55b7ef8 ompweb-dev#416 ompweb-dev#419 d89aa5a ompweb-dev#419 Co-authored-by: kahme247 <61059522+kahme247@users.noreply.github.com> Co-authored-by: Tanger <49036591+GTanger@users.noreply.github.com> Co-authored-by: lutfi-zain <147457356+lutfi-zain@users.noreply.github.com> Co-authored-by: OrwellVII <56531592+OrwellVII@users.noreply.github.com> Co-authored-by: pengshuai <pengshuai4@lenovo.com> Co-authored-by: todouu <pslzj@outlook.com> Co-authored-by: tianzishen <tianzishen@local> Co-authored-by: killcerr <kill_cerr@outlook.com> Co-authored-by: tianzishen <tianzishen@sensetime.com> Co-authored-by: RoyaLemonade <37620553+RoyaLemonade@users.noreply.github.com>
|
Hi @kahme247, thank you for your contribution, and apologies for the long wait on this PR. We really appreciate the time and effort you have put into it. We are working through a major refactor of ompweb, including switching to our own build of omp. We are close to finishing that work; once the refactor is complete, we will turn our attention back to the pending PRs, including this one. Thank you for your patience and for helping improve ompweb! |
|
Hi, thanks for this PR. It currently conflicts with main and can't be merged as-is — please rebase it onto current main and resolve the conflicts. Once it's rebased I'll re-run the checks. This is a one-line fix and maintainer-prioritized — after the rebase it just needs the source-spelling test replaced with a behavioral test. |
|
Closing this as superseded by maintainer rework #551, which rebases this fix onto current main and replaces the source-spelling test with a behavioral test (native watcher follows the XDG sessions dir so external changes reach the sidebar; the test times out without the fix and passes with it). |
…11-23 fix(modules): watch getSessionsDir() so XDG sessions reach the sidebar (rework of ompweb-dev#303)
Round-2 bug-hunt finding (Area 2, Modules and chats), verified by reproduction in a fresh clone at 0.6.0 (7d0ce59).
Bug (MEDIUM)
The session-file watcher derived its directory from
getAgentDir()(~/.omp/agent/sessions), while every other session consumer usesgetSessionsDir(), which honors the XDG layout (/omp/sessionswhen theomp config init-xdgopt-in exists). Under XDG the watcher watched a directory the lister never reads, so sessions started or changed outside omp-web (terminalomp, the TUI, a second instance) never pushedsessions-changedto the sidebar; when the legacy directory did not exist, the watcher retried the same wrong path every 5 s forever.Reproduction: with a fake HOME + XDG pair,
getSessionsDir()→ XDG sessions dir while the old watcher path → legacy dir (mismatch); appending a line to the real XDG session file produced zero notifications, while the default-layout control produced one.Fix
lib/session-watcher.tsnow usesgetSessionsDir()— a one-line change that also fixes the retry loop, since the watched directory then exists. Regression guard in newlib/session-watcher.test.mjs.Verification
tsc --noEmitclean, eslint clean on changed files.next buildnot run per house rules.Not covered by open PRs #295–#300 (round-1 modules PR #297 covers project re-add, worktree collision, cwd-less sessions, dead last-session code — not the watcher path). No GitHub issue closed, so no Fixes trailer.