Skip to content

feat: make exit-summary reasoning effort configurable - #35

Open
mellon85 wants to merge 1 commit into
jayzeng:mainfrom
mellon85:feat/configurable-exit-summary-reasoning-effort
Open

feat: make exit-summary reasoning effort configurable#35
mellon85 wants to merge 1 commit into
jayzeng:mainfrom
mellon85:feat/configurable-exit-summary-reasoning-effort

Conversation

@mellon85

Copy link
Copy Markdown

Problem

The exit-summary LLM call hardcodes reasoningEffort: "low":

const response = await complete(
    model,
    { systemPrompt: EXIT_SUMMARY_SYSTEM_PROMPT, messages: summaryMessages },
    { apiKey, reasoningEffort: "low" },
);

Some providers reject that value, silently breaking exit summaries. For example, Baseten's GLM-5.2 only accepts high/max/none and returns HTTP 400 for low:

Provider 'baseten' returned 400 for model 'zai-org/GLM-5.2':
Invalid request: reasoning_effort must be one of high, max, none; got 'low'.

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_EFFORT to override the reasoning 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.

Changes

  • Export getExitSummaryReasoningEffort() and use it in generateExitSummary
  • Surface the setting in memory_status output
  • Document the new env var in the README config table
  • Add unit tests for default, pass-through, case-insensitivity, off, and empty-string handling

Testing

  • bun test test/unit.test.ts — 187 pass, 0 fail
  • tsc -p tsconfig.json --noEmit — clean
  • biome check . — clean

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>
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.

1 participant