feat: add Control Center Opencode handoff - #26
Merged
Conversation
ts-030640 still lacked the session-detail handoff path after the menu bar deep-link slice landed on main. Operators could inspect a live session in the Control Center, but they could not jump from that detail pane into an interactive Opencode attach flow, which left the ticket incomplete. The missing piece was a launcher that used the supported session metadata contract instead of inventing a new attach path. The UI only surfaced attachability diagnostics, so there was no preflighted route from the selected session to the existing af session attach workflow. This change adds a dedicated SessionHandoffLauncher that validates the target against the local session registry, opens Terminal with the supported af session attach command, and reports success or failure inline in the session detail panel. It also adds focused launcher tests and updates the verification matrix for the new behavior.
The repository had an uncommitted local ignore change for the top-level .worktrees directory. Keeping it untracked avoids noise from local worktree management in git status. This commit adds the ignore entry without mixing it into the Control Center feature work.
The initial Control Center handoff implementation preflighted with null before opening Terminal. That added a second source of truth for session existence even though the UI was already rendering daemon-provided session detail with , , and . This follow-up removes the CLI registry preflight and trusts the daemon-owned session metadata the app already consumed to render the selected session. The launcher now validates only the local handoff inputs and executes the real flow directly, while tests cover the launch path and attach-command failure handling.
Review on the Control Center handoff work surfaced three concrete issues: the launcher could block forever while waiting on osascript, the SwiftUI view owned the launch orchestration directly, and the button could queue duplicate launches before the async state flipped to launching. This change moves handoff state and launch orchestration into a dedicated SessionHandoffStore, so the view stays declarative and disables the button synchronously. It also hardens SessionHandoffLauncher with invariant checks, bounded process waiting, forced termination on timeout, and structured logging around launch attempts and failures. The test suite now covers the store-level launch transitions in addition to the launcher command and failure cases.
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.
ts-030640 adds the remaining Control Center session-detail handoff flow so an operator can jump from a selected session into the supported Opencode attach path without leaving the app.
This PR:
Open in Opencodeaction to the session detail panelaf session attach <session-id> --server <server-ref>flow using daemon-owned session metadata.worktreesdirectory