[FEATURE]: Use a cheap model to name sessions #2735

Open
opened 2026-02-16 17:37:01 -05:00 by yindo · 7 comments
Owner

Originally created by @ibehnam on GitHub (Nov 9, 2025).

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

When sending a request to a model in a new session, it's first asked to name the session. This wastes tokens especially with expensive models like gpt-5-pro. It also dramatically slows down user experience esp. with local models.

Can we have a setting in ~/.config/opencode/opencode.json that specifies which model should be used to name sessions?

Also, the entire tools/MCPs need not be sent to this naming model! Just the user query.

Moreover, this shouldn't be blocking. The actual user query to the expensive model should be sent with this request asynchronously.

Originally created by @ibehnam on GitHub (Nov 9, 2025). ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request When sending a request to a model in a new session, it's first asked to name the session. This wastes tokens especially with expensive models like gpt-5-pro. It also dramatically slows down user experience esp. with local models. Can we have a setting in `~/.config/opencode/opencode.json` that specifies which model should be used to name sessions? Also, the entire tools/MCPs need not be sent to this naming model! Just the user query. Moreover, this shouldn't be blocking. The actual user query to the expensive model should be sent with this request asynchronously.
yindo added the discussion label 2026-02-16 17:37:01 -05:00
Author
Owner

@rekram1-node commented on GitHub (Nov 9, 2025):

@ibehnam what provider are you using, we use a cheap model by default but fall back to the same model u are using as a fallback

@rekram1-node commented on GitHub (Nov 9, 2025): @ibehnam what provider are you using, we use a cheap model by default but fall back to the same model u are using as a fallback
Author
Owner
@rekram1-node commented on GitHub (Nov 9, 2025): code: https://github.com/sst/opencode/blob/d9ffe07391d91459c1d400cf4da1d451b7d526de/packages/opencode/src/provider/provider.ts#L574
Author
Owner

@rekram1-node commented on GitHub (Nov 9, 2025):

Moreover, this shouldn't be blocking. The actual user query to the expensive model should be sent with this request asynchronously.

The title generation isn't blocking either, we do await it on shutdown but it doesnt block otherwise

@rekram1-node commented on GitHub (Nov 9, 2025): > Moreover, this shouldn't be blocking. The actual user query to the expensive model should be sent with this request asynchronously. The title generation isn't blocking either, we do await it on shutdown but it doesnt block otherwise
Author
Owner

@Tarquinen commented on GitHub (Nov 9, 2025):

Although the issue is innacurate, he's right that naming sessions could use some work. One problem I have with them is that the session name is just based on the first prompt, even though the rest of the session conversation could be entirely different. Maybe we need some way to retrigger the small model to make a new name, giving it context of all the user prompts (maybe also the last AI message after each user prompt?)

@Tarquinen commented on GitHub (Nov 9, 2025): Although the issue is innacurate, he's right that naming sessions could use some work. One problem I have with them is that the session name is just based on the first prompt, even though the rest of the session conversation could be entirely different. Maybe we need some way to retrigger the small model to make a new name, giving it context of all the user prompts (maybe also the last AI message after each user prompt?)
Author
Owner

@rekram1-node commented on GitHub (Nov 9, 2025):

@Tarquinen yeah i think adding a way to do that could be good

@rekram1-node commented on GitHub (Nov 9, 2025): @Tarquinen yeah i think adding a way to do that could be good
Author
Owner

@atkr commented on GitHub (Nov 9, 2025):

IMO - It would be nice to be able to configure the model to name sessions. I'm using the copilot provider and I would configure ["grok-code-fast-1", "gpt-4.1", "gpt-5-mini"] (in order of priority) for this purpose as their usage is unlimited with my plan.

@atkr commented on GitHub (Nov 9, 2025): IMO - It would be nice to be able to configure the model to name sessions. I'm using the copilot provider and I would configure `["grok-code-fast-1", "gpt-4.1", "gpt-5-mini"]` (in order of priority) for this purpose as their usage is unlimited with my plan.
Author
Owner

@rekram1-node commented on GitHub (Nov 9, 2025):

@atkr u can configure it using small_model in your opencode.json

@rekram1-node commented on GitHub (Nov 9, 2025): @atkr u can configure it using small_model in your opencode.json
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2735