fix: store recap state in XDG state dir for cross-runtime installs#5
Open
jms830 wants to merge 1 commit into
Open
fix: store recap state in XDG state dir for cross-runtime installs#5jms830 wants to merge 1 commit into
jms830 wants to merge 1 commit into
Conversation
The global model override, blacklist, and debug log were hardcoded under ~/.pi/agent/extensions/pi-recap/. That path is pi-specific and surprising under other hosts (e.g. oh-my-pi installs the package at ~/.omp/plugins/node_modules/pi-recap, where state living inside the package dir is wiped on every reinstall). Resolve state under the XDG state dir instead: PI_RECAP_HOME -> <cwd>/state (dev) -> $XDG_STATE_HOME/pi-recap (default ~/.local/state/pi-recap), with a read fallback to the legacy ~/.pi/agent/extensions/pi-recap location when it already exists. Host-neutral (identical under pi and oh-my-pi), survives reinstalls, and keeps existing pi users' state in place via the legacy fallback.
jms830
pushed a commit
to jms830/pi-recap
that referenced
this pull request
Jun 26, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The global model override (
state/config.json), the blacklist, and the debug log were resolved to a hardcoded~/.pi/agent/extensions/pi-recap/path. Two issues:~/.omp/plugins/node_modules/pi-recap, so writing state into~/.pi/...is surprising, and earlier attempts to keep state inside the package dir get wiped on everybun install/reinstall (node_modules).Change
Resolve state under the XDG state dir, host-neutrally, in all three files (
state/config.ts,state/blacklist.ts,util/log.ts):~/.pi-vs-~/.ompbranching.node_modules.Notes
.jsfiles regenerated from.tswith the repo transpile (tsc --module esnext --target es2022 --moduleResolution bundler); unchanged siblings emit byte-identical.tsc --noEmitadds no new type errors vsmain;ubsreports 0 critical / 0 warning on all three files (unchanged frommain).CLAUDE.mdpath references updated to match.HOME/XDG_STATE_HOMEharness.