Skip to content

feat(opencode): Reflect native Plan and Build selections - #31

Closed
mwolson wants to merge 1 commit into
contrib/ctm/opencode-providerfrom
contrib/ctm/opencode-native-mode-reflection
Closed

mwolson wants to merge 1 commit into
contrib/ctm/opencode-providerfrom
contrib/ctm/opencode-native-mode-reflection

Conversation

@mwolson

@mwolson mwolson commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

What Changed

When OpenCode switches its root session between the Plan and Build agents during a turn T3 started, the thread's interaction mode in T3 Code follows, so the composer shows Plan or Default to match. Only live selections from that thread's own root session count, and only ones OpenCode made after the turn started. Child sessions, replayed events, quarantined or stopped work, and background activity cannot change the mode.

A user's own change to the mode, runtime mode, model or provider after the turn started always wins, and a thread an agent created in Plan mode is never switched back automatically. Each reflection is applied once, even if it is retried.

Why

Switching agents inside OpenCode left T3 showing the old mode, so the next message was sent with a mode the agent had already left. Following only the turn T3 admitted, and re-checking the thread under its lock before applying, keeps stale or foreign selections from overriding the user.

UI Changes

The composer's Plan and Default toggle can change on its own to follow OpenCode. No screenshots are attached.

Checklist

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

@mwolson
mwolson added this pull request to stack #36 September 27, 2026 21:48
@mwolson
mwolson force-pushed the contrib/ctm/opencode-native-mode-reflection branch from 3d1cf4f to c833511 Compare September 28, 2026 02:58
@mwolson
mwolson force-pushed the contrib/ctm/opencode-provider branch 2 times, most recently from aa5ff19 to 5954c86 Compare September 30, 2026 12:58
@mwolson
mwolson force-pushed the contrib/ctm/opencode-native-mode-reflection branch from c833511 to 01f02e7 Compare September 30, 2026 12:58
@mwolson
mwolson force-pushed the contrib/ctm/opencode-provider branch from 5954c86 to a06c994 Compare September 30, 2026 20:01
@mwolson
mwolson force-pushed the contrib/ctm/opencode-native-mode-reflection branch from 01f02e7 to 1bded9a Compare September 30, 2026 20:01
@mwolson
mwolson removed this pull request from stack #36 October 1, 2026 12:39
@mwolson

mwolson commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Replaced by Julius's upstream OpenCode 2 stack (pingdotgg#14239 oc2-1-runtime-probe onward), now carried on the fork as #45 oc2-4b-adapter-usage through #51 opencode2-continuation-ownership. Closing; the branch is kept.

@mwolson mwolson closed this Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant