feat: make exit-summary reasoning effort configurable - #35
Open
mellon85 wants to merge 1 commit into
Open
Conversation
The exit-summary LLM call hardcoded reasoningEffort: "low". Some providers reject that value, silently breaking exit summaries: Baseten's GLM-5.2 only accepts high/max/none and returns HTTP 400 for "low", so the error is caught, the summary is null, and nothing is ever written to the daily log. Add PI_MEMORY_EXIT_SUMMARY_REASONING_EFFORT to override the effort (defaults to "low" for backward compatibility). Set it to a value the configured PI_MEMORY_EXIT_SUMMARY_MODEL accepts, or "off" to omit the parameter entirely and let the provider apply its own default. - Export getExitSummaryReasoningEffort() and use it in generateExitSummary - Surface the setting in memory_status - Document the new env var in the README config table - Add unit tests for default, pass-through, case-insensitivity, off, and empty-string handling Signed-off-by: Dario Meloni <dario@dariomeloni.eu>
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.
Problem
The exit-summary LLM call hardcodes
reasoningEffort: "low":Some providers reject that value, silently breaking exit summaries. For example, Baseten's GLM-5.2 only accepts
high/max/noneand returns HTTP 400 forlow:The error is caught, the summary comes back
null, and nothing is ever written to the daily log. Users on affected providers never get exit summaries, with no indication of why.Fix
Add
PI_MEMORY_EXIT_SUMMARY_REASONING_EFFORTto override the reasoning effort (defaults to"low"for backward compatibility). Set it to a value the configuredPI_MEMORY_EXIT_SUMMARY_MODELaccepts, or"off"to omit the parameter entirely and let the provider apply its own default.Changes
getExitSummaryReasoningEffort()and use it ingenerateExitSummarymemory_statusoutputoff, and empty-string handlingTesting
bun test test/unit.test.ts— 187 pass, 0 failtsc -p tsconfig.json --noEmit— cleanbiome check .— clean