Skip to content

feat: optional session saving with :PiToggleSession - #28

Merged
pablopunk merged 1 commit into
pablopunk:mainfrom
danielvelara:feat/session-toggle
Oct 12, 2026
Merged

pablopunk merged 1 commit into
pablopunk:mainfrom
danielvelara:feat/session-toggle

Conversation

@danielvelara

Copy link
Copy Markdown
Contributor

Summary

pi.nvim always runs pi with --no-session, so requests from :PiAsk / :PiAskSelection cannot be revisited later with pi --resume. This PR makes session saving opt-in.

  • New session config option (default false, so existing behavior is unchanged). When true, --no-session is omitted and pi persists each request as a session.
  • New :PiToggleSession command to flip the option at runtime (notifies the new state). Applies to the next request.
  • README docs for both.
require("pi").setup({ session = true })

Note: each request still creates its own session; this does not chain requests into one conversation (--continue).

Tests

Added tests for session = true, invalid session values, and :PiToggleSession toggling both ways. make test: 42/42 passing.

@pablopunk

Copy link
Copy Markdown
Owner

fixes #21

@pablopunk
pablopunk merged commit 0ef8a23 into pablopunk:main Oct 12, 2026
4 checks passed
@pablopunk pablopunk mentioned this pull request Oct 12, 2026
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.

2 participants