[PR #11132] fix(session): restore summary body generation #13664

Open
opened 2026-02-16 18:18:30 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11132

State: open
Merged: No


Restores the summary body generation that was accidentally removed in 71a7ad1a4.

Fixes #11133

What does this PR do?

That commit ("fix model selection in title generation to use user's model instead of assistant's") removed the assistantMsg/small variable and deleted the entire body generation block as collateral damage instead of updating it. The "summary" agent and prompt still exist but are never called.

This means userMsg.summary.body is always undefined since v1.1.15, which breaks downstream consumers that rely on the summary body.

Solution

Re-adds the body generation block after title generation in summarizeMessage(), adapted to the current code:

  • Uses userMsg.model.providerID instead of the removed assistantMsg.providerID
  • Uses MessageV2.toModelMessages() (updated API with model param)
  • Adds if (summaryAgent) null guard consistent with title's if (!agent) return
  • Keeps the diffs.length > 0 optimization from 651a10d6d

How did you verify your code works?

  • tsgo --noEmit passes for opencode package
  • Full build succeeds (all platforms)
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11132 **State:** open **Merged:** No --- Restores the summary body generation that was accidentally removed in 71a7ad1a4. Fixes #11133 ## What does this PR do? That commit ("fix model selection in title generation to use user's model instead of assistant's") removed the `assistantMsg`/`small` variable and deleted the entire body generation block as collateral damage instead of updating it. The `"summary"` agent and prompt still exist but are never called. This means `userMsg.summary.body` is always `undefined` since v1.1.15, which breaks downstream consumers that rely on the summary body. ## Solution Re-adds the body generation block after title generation in `summarizeMessage()`, adapted to the current code: - Uses `userMsg.model.providerID` instead of the removed `assistantMsg.providerID` - Uses `MessageV2.toModelMessages()` (updated API with model param) - Adds `if (summaryAgent)` null guard consistent with title's `if (!agent) return` - Keeps the `diffs.length > 0` optimization from 651a10d6d ## How did you verify your code works? - [x] `tsgo --noEmit` passes for `opencode` package - [x] Full build succeeds (all platforms)
yindo added the pull-request label 2026-02-16 18:18:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13664