Skip to content

feat(tui): let /tui/select-session target one attached TUI - #52869

Open
moritzWa wants to merge 1 commit into
anomalyco:devfrom
moritzWa:feat/tui-select-session-target
Open

moritzWa wants to merge 1 commit into
anomalyco:devfrom
moritzWa:feat/tui-select-session-target

Conversation

@moritzWa

@moritzWa moritzWa commented Oct 2, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #53649

Also the session-switch half of #39181. The directory-scoping half of that issue isn't touched here.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

POST /tui/select-session navigates every TUI attached to the server, because the tui.session.select handler in app.tsx only checks workspace. Directory scoping wouldn't fix that when several TUIs share one directory (for example, a session switcher that drives one of several panes in the same repo).

This adds an optional client field to the request and event, and a --client <id> flag on opencode and opencode attach. A TUI ignores a select event whose client is set to a different id. If client is left out, every TUI still navigates, so existing callers keep working.

The SDK changes come from re-running packages/sdk/js build.

How did you verify your code works?

  • New test in test/server/session-select.test.ts checks that client is published with the event. The existing select tests, httpapi-sdk.test.ts, and the codemode tests pass.
  • Manual check: started a server and attached two TUIs to the same session with --client a and --client b. Selecting with client: "b" moved only b. Selecting without client moved both.

Screenshots / recordings

select-session with and without client

Two TUIs attached to one server, --client a on the left and --client b on the right. Selecting with "client":"b" moves only the right one. Selecting without client moves both, as before. (mp4)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

This branch has not been deployed

No deployments
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.

/tui/select-session switches every attached TUI instead of one

1 participant