Skip to content

fix: delegate OpenCode session titles to provider#3720

Open
tris203 wants to merge 3 commits into
pingdotgg:mainfrom
tris203:feature/opencode-title-sync
Open

fix: delegate OpenCode session titles to provider#3720
tris203 wants to merge 3 commits into
pingdotgg:mainfrom
tris203:feature/opencode-title-sync

Conversation

@tris203

@tris203 tris203 commented Jul 5, 2026

Copy link
Copy Markdown

What Changed

  • 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

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

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes

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 title on session.create; only permission rules are sent so OpenCode owns title generation, matching the native app.

When OpenCode emits session.updated with a non-empty title, the adapter now maps that to thread.metadata.updated (payload.name plus metadata.sessionID). Session filtering for subscribed events also resolves the session id from either properties.sessionID or properties.info.id (needed for session.updated).

Adapter tests assert create payloads omit title and 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

  • Removes the title field from the session.create payload so OpenCode owns title generation instead of the caller.
  • Adds a session.updated event handler in makeOpenCodeAdapter that extracts the title from the event and emits a thread.metadata.updated runtime event.
  • Adds openCodeEventSessionId to also accept session IDs from properties.info.id, in addition to properties.sessionID.

Macroscope summarized 4bee25b.

- 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
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 83a941cb-ae2f-4c5b-a201-87c06308d015

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Jul 5, 2026
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Outdated
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant