You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(omp): read omp's XDG store on macOS, and list resumable sessions from it - #3832
Fixes#3746. Thanks to @Parsifa1 for the report and for pointing at both places in the code.
Waits for the release freeze: this touches server/, so it merges only after the 0.5.4 Release run.
Cause
The fault is in how the store is found on macOS. It does not depend on which omp version runs, and the session identity work does not cover it.
Chat view:ompStoreLayout (server/omp.ts) treated an existing $XDG_DATA_HOME/omp or $XDG_STATE_HOME/omp on macOS as unproved and returned null, so the pane showed no chat. The reason, from fix(omp): find transcripts in the store the pane's omp process moved #1898: omp reads XDG roots on macOS only from 18.12, and the bridge cannot tell which version runs. But omp writes into an XDG root only after omp config init-xdg has migrated into it, and that migration runs on macOS only from the same release (fix(xdg): add darwin support can1357/oh-my-pi#412, by the reporter). An XDG omp root on macOS was therefore made by an omp that reads it. omp's current packages/utils/src/dirs.ts treats darwin exactly like linux (xdgPlatform).
Resume (/resume list):listSessions("omp", …) (server/session-history.ts) always looked in ~/.omp/agent/sessions, on every platform. A store moved by XDG_DATA_HOME, PI_CONFIG_DIR or a profile listed nothing.
Change
ompStoreLayout reads the XDG roots on macOS as on Linux. Windows still refuses an XDG omp root.
Resume finds omp's sessions through ompStoreLayout(["omp"], <the server's environment>), the same resolver the chat view uses. It falls back to ~/.omp/agent/sessions when that resolver proves nothing, or when it names a flat session directory of omp's own, which the resume list did not read before either.
Behaviour that stays as it was: an omp older than 18.12 on macOS whose user created $XDG_DATA_HOME/omp by hand shows no chat. Its transcript lies outside the store, and the containment checks refuse it, so the pane never shows a wrong session.
Validation
Reproduced on origin/main (79420d0) with the new assertions, before the fix: ompStoreLayout(["omp"], xdg, "darwin") returned null, and listSessions("omp") with XDG_DATA_HOME set listed the default-store session instead of the XDG one.
bun test server/omp.test.ts server/session-history.test.ts server/session-history-routes.test.ts server/pi-session-metadata.test.ts: 240 pass, 0 fail.
bun run check fast: all ok (typecheck, build, unit 17241 pass / 0 fail / 54 skip).
Skipped: a live run on a Mac (eamac). The change is a platform branch in pure path resolution, and the tests pass darwin to it explicitly. Integration and browser suites were not run locally.
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Bug Fixes
Fixed session storage and resume listings for macOS when sessions are stored in XDG folders.
Session listings now use the configured session folder when XDG_DATA_HOME or PI_CONFIG_DIR selects a populated store, including profile-specific locations.
When the selected XDG folder has no sessions, listings continue to use the default session store.
OMP XDG roots are now accepted on macOS. Session listings use the selected OMP sessions directory when its layout is recognized, with a default-store fallback.
ompStoreLayout accepts XDG OMP roots on Linux and macOS. Its documentation identifies macOS support from omp 18.12, and tests expect XDG-based storage on macOS and null on Windows.
Select the OMP sessions directory server/session-history.ts, server/session-history.test.ts, changelog.d/omp-xdg-on-macos.md
listSessions derives the store layout from the environment and resolved HOME. It uses the layout’s sessions directory when the depth is 2 and otherwise falls back to ~/.omp/agent/sessions. Tests cover default, XDG, and PI_CONFIG_DIR stores, plus fallback when the expected XDG store is absent. The changelog records the macOS chat and resume-listing fixes.
This change makes macOS resolve omp's XDG session folders so chat and /resume work after the move to XDG. In a narrow case, omp older than 18.12 with a manually created XDG folder, /resume stops listing sessions from the default folder. The sessions are not deleted and the listing returns after upgrading omp or removing the folder. The change is mergeable with that known limitation.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the two changes in the PR: reading omp's XDG store on macOS in the chat view (ompStoreLayout) and listing resumable sessions from that store. The raw summary and objectives both cover …
Description check
The description follows the template's Change and Validation sections. It explains the cause, the fix, the behavior that stays the same, and the validation run. It links issue #3746 and gives the repr…
Linked Issues check
Issue #3746 has two coding requirements. (1) Chat view on macOS must find omp transcripts under XDG roots. The diff in server/omp.ts changes the platform check in ompStoreLayout from rejecting every n…
Out of Scope Changes check
All changed areas map to #3746 or to its stated mechanism. server/omp.ts changes the macOS XDG check and its doc comment. server/session-history.ts changes omp resume lookup to use the same resolver a…
Full details: Title check
Explanation
The title names the two changes in the PR: reading omp's XDG store on macOS in the chat view (ompStoreLayout) and listing resumable sessions from that store. The raw summary and objectives both cover these changes, so the title matches the main change. It is long at 76 characters, but it is specific.
Full details: Description check
Explanation
The description follows the template's Change and Validation sections. It explains the cause, the fix, the behavior that stays the same, and the validation run. It links issue #3746 and gives the reproduction and test results. The template asks for a changelog entry and a check list; the changelog file is in the diff, and the validation section lists the checks run and skipped. The Change section does not explicitly describe the user-facing behavior as a feature, which the template does not require for a fix.
Full details: Linked Issues check
Explanation
Issue #3746 has two coding requirements. (1) Chat view on macOS must find omp transcripts under XDG roots. The diff in server/omp.ts changes the platform check in ompStoreLayout from rejecting every non-Linux platform to rejecting only non-Linux, non-darwin platforms (platform !== "linux" && platform !== "darwin"). macOS XDG roots now resolve to a store, and Windows still returns null. (2) /resume on macOS must list the XDG-store sessions. The diff in server/session-history.ts replaces the fixed ~/.omp/agent/sessions lookup for omp with ompStoreLayout(["omp"], environ, budget.platform), using the layout sessions when depth is 2 and the default path otherwise. The PR summary lists new tests in server/omp.test.ts and server/session-history.test.ts that cover the darwin XDG case and the resume store selection. I did not run those tests. The claim that omp 18.12 gates XDG reads and migration on macOS comes from an external PR and is not verified in this repository. That claim does not change the coding result for the issue's reported case (omp 18.19.0).
Full details: Out of Scope Changes check
Explanation
All changed areas map to #3746 or to its stated mechanism. server/omp.ts changes the macOS XDG check and its doc comment. server/session-history.ts changes omp resume lookup to use the same resolver as the chat view. The tests cover those two paths. changelog.d/omp-xdg-on-macos.md documents the fix. One effect is not limited to macOS: the resume lookup now also uses the XDG and PI_CONFIG_DIR store on Linux, because the resolver is shared and the Linux branch was already accepted. The PR description states this shared behavior. It is a consequence of the same fix and not a demonstrated unrelated change.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Reviewing files that changed from the base of the PR and between 79420d0 and c50059c.
Files selected for processing: 5
changelog.d/omp-xdg-on-macos.md
server/omp.test.ts
server/omp.ts
server/session-history.test.ts
server/session-history.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
Merged head c50059c782a2 as 94257c895690 on GitHub's checks, with no unresolved review threads.
Reviewer
Verdict
Note
claude
CLEAR
codex
CLEAR
Left open, not blocking (owner PR; MEDIUM and LOW do not block):
MEDIUM (both; traced): Resume lists omp sessions from the Ovis server environment (OMP_PROFILE, XDG_*, PI_CONFIG_DIR) but launches omp --resume <id> in a tab whose shell may differ, so a listed session may not resume (claude rated it LOW; an installed service does not share the shell environment)
MEDIUM (codex; not run): an existing XDG store on macOS does not prove the running omp is 18.12 or later; with an older omp the real transcript is rejected and a path inside the XDG store may be accepted as the pane's
Review reports: ~/.cache/ovis-tmp/reports/ (pr-3832-c50059c7-*.report.md)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3746. Thanks to @Parsifa1 for the report and for pointing at both places in the code.
Cause
The fault is in how the store is found on macOS. It does not depend on which omp version runs, and the session identity work does not cover it.
ompStoreLayout(server/omp.ts) treated an existing$XDG_DATA_HOME/ompor$XDG_STATE_HOME/ompon macOS as unproved and returnednull, so the pane showed no chat. The reason, from fix(omp): find transcripts in the store the pane's omp process moved #1898: omp reads XDG roots on macOS only from 18.12, and the bridge cannot tell which version runs. But omp writes into an XDG root only afteromp config init-xdghas migrated into it, and that migration runs on macOS only from the same release (fix(xdg): add darwin support can1357/oh-my-pi#412, by the reporter). An XDG omp root on macOS was therefore made by an omp that reads it. omp's currentpackages/utils/src/dirs.tstreatsdarwinexactly likelinux(xdgPlatform)./resumelist):listSessions("omp", …)(server/session-history.ts) always looked in~/.omp/agent/sessions, on every platform. A store moved byXDG_DATA_HOME,PI_CONFIG_DIRor a profile listed nothing.Change
ompStoreLayoutreads the XDG roots on macOS as on Linux. Windows still refuses an XDG omp root.ompStoreLayout(["omp"], <the server's environment>), the same resolver the chat view uses. It falls back to~/.omp/agent/sessionswhen that resolver proves nothing, or when it names a flat session directory of omp's own, which the resume list did not read before either.Behaviour that stays as it was: an omp older than 18.12 on macOS whose user created
$XDG_DATA_HOME/ompby hand shows no chat. Its transcript lies outside the store, and the containment checks refuse it, so the pane never shows a wrong session.Validation
origin/main(79420d0) with the new assertions, before the fix:ompStoreLayout(["omp"], xdg, "darwin")returnednull, andlistSessions("omp")withXDG_DATA_HOMEset listed the default-store session instead of the XDG one.bun test server/omp.test.ts server/session-history.test.ts server/session-history-routes.test.ts server/pi-session-metadata.test.ts: 240 pass, 0 fail.bun run check fast: all ok (typecheck, build, unit 17241 pass / 0 fail / 54 skip).darwinto it explicitly. Integration and browser suites were not run locally.