Repository navigation
Conversation
OpenCode titles an untitled root session with its own model on the first prompt, so every T3 thread cost an extra model call and showed a different name in OpenCode than in T3. Create the session with the thread's title and rename it before a turn when the thread was renamed since.
Contributor
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a focused OpenCode 2 bug fix that keeps native session names aligned with existing T3 thread titles and prevents an unnecessary automatic title-generation request. The implementation is localized, additive for other providers, and covered by targeted tests and updated fixtures. You can add or adjust custom eligibility rules. Learn more. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
T3 creates an OpenCode 2 session without a title. On the first prompt OpenCode then titles it with its own model (one extra request per thread on its small model), and
opencode's session list shows that title, not the thread's name in T3. Renaming the thread in T3 never reaches the session.On nightly 2849 with OpenCode 2.0.25 and the Cursor provider, two new OpenCode threads each made one extra tool-less title run on their session, and both sessions ended up with OpenCode's titles ("Calculate 17 times 23" for a thread T3 showed as "What is 17 times 23? Reply with just the number.").
Change
ProviderAdapterV2EnsureThreadInputgets an optionaltitle;ProviderTurnStartServicepasses the thread's current title (the seed, at the first turn).session.updatetreats an empty title as "generate one".Other providers ignore the new field.
Scope and approval
This changes what OpenCode shows, so it needs a maintainer's yes. I proposed it in #14809, which asks for the same thing for Claude sessions: comment. No approval yet; happy to close this if you'd rather do it another way.
Verification
OpenCode2AdapterV2.test.ts: a new session is created with the trimmed thread title and its first turn sends no update; a renamed thread sends onesession.updatewith the new title before its prompt, and none on the next turn under the same title.OpenCode2OrchestratorV2.integration.test.ts: the scripted sessions are now created with the thread's title. Two recorded transcripts gained the one title update the change adds:opencode2_fork(the forked session carries the source's title) andopencode2_switch(the resumed session's recorded title differs from the thread's).vp test runon the two files above,OrchestratorReplayFixtures.integration.test.ts,ProviderTurnStartService.test.tsandProviderSessionManager.test.ts: all pass. Lint, fmt and typecheck pass.provider-opencode'sOpenCodeServerLedger.test.tshas 5 darwin-only failures on Linux, onmaintoo.Model: Claude Opus 5.5 (1M). Harness: OpenCode in T3 Code.