Skip to content

refactor(pi): PathResolver::new takes a required home argument - #212

Open
ecalifornica wants to merge 1 commit into
robert/config-cursorfrom
robert/config-pi
Open

refactor(pi): PathResolver::new takes a required home argument#212
ecalifornica wants to merge 1 commit into
robert/config-cursorfrom
robert/config-pi

Conversation

@ecalifornica

@ecalifornica ecalifornica commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Part of #185: the crate reads no environment variable, Config owns every read, and the caller supplies what the crate used to resolve itself.

Judgment calls:

  • Behavior change: the cwd fallback is deleted. A process without a home directory gets an error naming the fix, not a sessions directory relative to the current working directory. The relative fallback could list different sessions from different working directories, which is the wrong failure mode for a resolver.
  • The CLI path fixes pi: resolver home lookup ignores $USERPROFILE #192 structurally: the crate's $HOME-only read is gone, and Config::home_dir() falls back to $USERPROFILE, so Windows home resolution needs no patch in the crate.
  • --base chains with_sessions_dir onto the resolver, so it wins against the home argument. The resolver holds one field, the effective sessions directory; home is fixed at construction, so there is no cached recompute and no override flag.

@ecalifornica ecalifornica changed the title robert/config pi refactor(pi): PathResolver::new takes a required home argument Aug 14, 2026
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown

🔍 Preview deployed: https://acb3485a.toolpath.pages.dev

@ecalifornica
ecalifornica marked this pull request as ready for review August 17, 2026 18:06
@ecalifornica
ecalifornica requested a review from akesling August 17, 2026 18:06
@ecalifornica ecalifornica assigned akesling and unassigned akesling Aug 17, 2026
toolpath-pi reads no environment variable. The caller supplies the
home directory. The crate keeps the layout below it: Pi session logs
are in <home>/.pi/agent/sessions.

- PathResolver::new(home) takes the home directory as a required
  argument. PiConvo::new(home) takes the same argument.
- Deleted: the Default impls on PathResolver and PiConvo,
  PathResolver::with_home, and the $HOME read.
- with_sessions_dir stays as the full override. It beats the home
  argument.
- The resolver does not consult the current working directory. The
  ./.pi/agent/sessions fallback is gone.

path-cli:

- providers::pi_resolver returns Option<PathResolver>. None means the
  configuration carries no home directory.
- harness_bundle omits the Pi manager when the resolver is None.
- providers::require_pi_resolver turns None into an error. The 5
  commands that target Pi use it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pi: resolver home lookup ignores $USERPROFILE

2 participants