Skip to content

Unnecessary Haiku calls on every user message for per-message title generation #13802

@rmk40

Description

@rmk40

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:

  1. Start opencode, send multiple messages in a session
  2. 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.

Metadata

Metadata

Assignees

Labels

perfIndicates a performance issue or need for optimizationzenRelates to Zen

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions