summarizeMessage() in packages/opencode/src/session/summary.ts makes a small-model (typically Haiku) LLM call on every user message to generate a short per-message title stored in UserMessage.summary.title.
This is separate from the session-level title generated by ensureTitle() in prompt.ts, which runs once per session and populates Session.Info.title — the one shown in the session list.
The per-message summary.title is only consumed in one place: packages/ui/src/components/message-nav.tsx as a fallback label when getLabel is not provided. In practice, the main app always provides getLabel (which returns the raw prompt text), so summary.title is only reached on the enterprise share page tooltip. The TUI never displays it.
For a session with N user messages, this results in N unnecessary Haiku calls — one per message, every session, for every user.
Steps to reproduce:
- Start opencode, send multiple messages in a session
- Monitor API activity — observe a small-model call firing after each user message
The fix is to remove the LLM title generation from summarizeMessage() while keeping the diff computation intact.
summarizeMessage()inpackages/opencode/src/session/summary.tsmakes a small-model (typically Haiku) LLM call on every user message to generate a short per-message title stored inUserMessage.summary.title.This is separate from the session-level title generated by
ensureTitle()inprompt.ts, which runs once per session and populatesSession.Info.title— the one shown in the session list.The per-message
summary.titleis only consumed in one place:packages/ui/src/components/message-nav.tsxas a fallback label whengetLabelis not provided. In practice, the main app always providesgetLabel(which returns the raw prompt text), sosummary.titleis only reached on the enterprise share page tooltip. The TUI never displays it.For a session with N user messages, this results in N unnecessary Haiku calls — one per message, every session, for every user.
Steps to reproduce:
The fix is to remove the LLM title generation from
summarizeMessage()while keeping the diff computation intact.