Skip to content

feat: env opt-out for exit summary on real quit (Ctrl+D / /quit) #26

Description

@cokekitten

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions