fix: delegate OpenCode session titles to provider#3720
Conversation
- Stop sending a generated title when creating OpenCode sessions - Emit thread metadata updates from OpenCode session title events - Cover the title sync flow in adapter tests
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review Changes how session titles are generated, shifting from hardcoded client-side titles to provider-delegated titles via event streaming. This affects user-observable behavior (thread naming) and introduces new event handling logic, warranting human review. You can customize Macroscope's approvability policy. Learn more. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3ee7084. Configure here.

What Changed
This means that when a thread in opencode is created it created without a title, opencode generates the title and this is recieved by t3code
Why
Native opencode never recived the t3code title. This made it a bit disorientating when switching between t3code and the native app
Checklist
Note
Low Risk
Localized OpenCode adapter behavior around display titles and event mapping; no auth, persistence, or security-sensitive paths change.
Overview
OpenCode sessions are no longer created with a T3-generated
titleonsession.create; only permission rules are sent so OpenCode owns title generation, matching the native app.When OpenCode emits
session.updatedwith a non-empty title, the adapter now maps that tothread.metadata.updated(payload.nameplusmetadata.sessionID). Session filtering for subscribed events also resolves the session id from eitherproperties.sessionIDorproperties.info.id(needed forsession.updated).Adapter tests assert create payloads omit
titleand that title events surface as thread metadata updates.Reviewed by Cursor Bugbot for commit 4bee25b. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Delegate session title generation to OpenCode provider
titlefield from thesession.createpayload so OpenCode owns title generation instead of the caller.session.updatedevent handler inmakeOpenCodeAdapterthat extracts the title from the event and emits athread.metadata.updatedruntime event.openCodeEventSessionIdto also accept session IDs fromproperties.info.id, in addition toproperties.sessionID.Macroscope summarized 4bee25b.