Skip to content

feat: make exit summary configurable (opt-out + model override) - #27

Merged
jayzeng merged 1 commit into
jayzeng:mainfrom
cokekitten:feat/exit-summary-config
Aug 11, 2026
Merged

feat: make exit summary configurable (opt-out + model override)#27
jayzeng merged 1 commit into
jayzeng:mainfrom
cokekitten:feat/exit-summary-config

Conversation

@cokekitten

Copy link
Copy Markdown
Contributor

Implements the opt-out requested in #26, plus the model override discussed there. The hardening fixes from the issue's follow-up comment will come as a separate PR.

What

Two new env vars for the exit summary that runs on real quit (Ctrl+D, /quit, session end):

  • PI_MEMORY_EXIT_SUMMARY=0 (aliases off/false/no): skips the exit summary entirely — no LLM call and no qmd update, so quitting is instant. Lifecycle-transition behavior (/reload etc. skipping by default) is unchanged, and explicit memory_write during sessions is unaffected.
  • PI_MEMORY_EXIT_SUMMARY_MODEL=provider/model-id: routes the summary to a configured model (e.g. a cheaper/faster one) instead of always using the session's active model. Unresolvable specs fall back to the session model with a warning. resolveExitSummaryApiKey now takes the model as a parameter so the override model's credentials are used.

Both surface in the memory_status configuration section, the README env table, and the changelog.

Tests (TDD per AGENTS.md)

Baseline before edits: bun test test/unit.test.ts → 172 pass; tsc --noEmit and biome check clean.

New tests (added red, then green):

  • PI_MEMORY_EXIT_SUMMARY=0 on a real quit with a summarizable session: no API-key lookup, no daily-log write
  • alias values (off/false/no) disable; unset defaults to enabled (isExitSummaryEnabled())
  • PI_MEMORY_EXIT_SUMMARY_MODEL resolves via modelRegistry.find(provider, id) and the API key is requested for the override model, not the session model
  • unresolvable override falls back to the session model

After: 176 pass, 0 fail; tsc --noEmit and biome check clean.

Refs #26

Add two env knobs for the exit summary on real quit (Ctrl+D, /quit,
session end), requested in jayzeng#26:

- PI_MEMORY_EXIT_SUMMARY=0 (aliases off/false/no) skips the summary
  entirely: no LLM call and no qmd update, so quitting is instant.
  Lifecycle-transition skip behavior is unchanged.
- PI_MEMORY_EXIT_SUMMARY_MODEL=provider/model-id routes the summary to
  a configured model (e.g. cheaper/faster) instead of always using the
  session's active model. Unresolvable specs fall back to the session
  model with a warning.

Both surface in the memory_status configuration section, the README env
table, and the changelog. resolveExitSummaryApiKey now takes the model
as a parameter so the override model's credentials are used.

Refs jayzeng#26

Signed-off-by: Bowen M. <drmoaint@gmail.com>
@jayzeng
jayzeng merged commit 33fb2b4 into jayzeng:main Aug 11, 2026
3 checks passed
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