feat: make exit summary configurable (opt-out + model override) - #27
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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(aliasesoff/false/no): skips the exit summary entirely — no LLM call and noqmd update, so quitting is instant. Lifecycle-transition behavior (/reloadetc. skipping by default) is unchanged, and explicitmemory_writeduring 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.resolveExitSummaryApiKeynow takes the model as a parameter so the override model's credentials are used.Both surface in the
memory_statusconfiguration 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 --noEmitandbiome checkclean.New tests (added red, then green):
PI_MEMORY_EXIT_SUMMARY=0on a real quit with a summarizable session: no API-key lookup, no daily-log writeoff/false/no) disable; unset defaults to enabled (isExitSummaryEnabled())PI_MEMORY_EXIT_SUMMARY_MODELresolves viamodelRegistry.find(provider, id)and the API key is requested for the override model, not the session modelAfter: 176 pass, 0 fail;
tsc --noEmitandbiome checkclean.Refs #26