Problem
session_shutdown always runs generateExitSummary() on real quits (Ctrl+D, /quit, process exit): a full LLM call over up to 80K chars of transcript, followed by qmd update. Pi core awaits all session_shutdown handlers with no timeout, so quitting pi blocks until the summary LLM round-trip finishes — several seconds to tens of seconds depending on provider/model.
PI_MEMORY_SUMMARIZE_TRANSITIONS covers the opposite direction (opt-in summaries for /reload, /new, /resume, /fork, which skip by default since #7 / #8). There is currently no way to opt out of the summary on actual exits.
Proposal
Add a PI_MEMORY_EXIT_SUMMARY env var (e.g. 0/off to disable, default keeps current behavior), checked at the top of the session_shutdown handler. When disabled, skip generateExitSummary() and runQmdUpdateNow(), keeping only the cheap cleanup (terminal-input unsubscribe, timer clear).
Why
- Slow quit UX: every exit waits on an LLM round-trip plus
qmd update.
- Noise control: users who prefer curated writes only (explicit
memory_write during sessions) find auto-summaries of casual/chit-chat sessions add noise to the daily log and qmd index.
- Consistent with the project's existing env-var configuration style (
PI_MEMORY_SNAPSHOT, PI_MEMORY_QMD_UPDATE, PI_MEMORY_NO_SEARCH, …).
Happy to send a PR if you're open to it.
Problem
session_shutdownalways runsgenerateExitSummary()on real quits (Ctrl+D,/quit, process exit): a full LLM call over up to 80K chars of transcript, followed byqmd update. Pi core awaits allsession_shutdownhandlers with no timeout, so quitting pi blocks until the summary LLM round-trip finishes — several seconds to tens of seconds depending on provider/model.PI_MEMORY_SUMMARIZE_TRANSITIONScovers the opposite direction (opt-in summaries for/reload,/new,/resume,/fork, which skip by default since #7 / #8). There is currently no way to opt out of the summary on actual exits.Proposal
Add a
PI_MEMORY_EXIT_SUMMARYenv var (e.g.0/offto disable, default keeps current behavior), checked at the top of thesession_shutdownhandler. When disabled, skipgenerateExitSummary()andrunQmdUpdateNow(), keeping only the cheap cleanup (terminal-input unsubscribe, timer clear).Why
qmd update.memory_writeduring sessions) find auto-summaries of casual/chit-chat sessions add noise to the daily log and qmd index.PI_MEMORY_SNAPSHOT,PI_MEMORY_QMD_UPDATE,PI_MEMORY_NO_SEARCH, …).Happy to send a PR if you're open to it.