Skip to content

feat: add Control Center Opencode handoff - #26

Merged
baiirun merged 4 commits into
mainfrom
codex/ts-030640-menu-bar-deep-links
Mar 16, 2026
Merged

feat: add Control Center Opencode handoff#26
baiirun merged 4 commits into
mainfrom
codex/ts-030640-menu-bar-deep-links

Conversation

@baiirun

@baiirun baiirun commented Mar 16, 2026

Copy link
Copy Markdown
Owner

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:

  • adds an Open in Opencode action to the session detail panel
  • launches Terminal with the supported af session attach <session-id> --server <server-ref> flow using daemon-owned session metadata
  • moves handoff launch state into a dedicated store so the view stays declarative and duplicate launches are prevented
  • hardens the launcher with bounded process waiting, timeout termination, and failure logging
  • adds focused Swift tests for launcher behavior and store state transitions
  • includes a small housekeeping commit to ignore the local .worktrees directory

baiirun added 4 commits March 15, 2026 20:59
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.
@baiirun
baiirun merged commit 668cfff into main Mar 16, 2026
2 checks passed
@baiirun
baiirun deleted the codex/ts-030640-menu-bar-deep-links branch March 16, 2026 02:35
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