Repository navigation
fix(gateway): one host terminal per session (#194 slice C) - #176
Merged
Merged
Conversation
…ead of queueing another (#194 slice C) The page asks for a host terminal on every pick of a conversation, and the launcher only coalesces duplicates within 12 s, so picking one conversation twice an hour apart opened a second tab on it. POST /rc/terminals now checks for a live process whose argv carries --attach-session <id> (new hostMirrors module, reads /proc/*/cmdline directly, injectable lister, exact id match). If one exists it answers 200 {alreadyMirrored: true, sessionId} and writes no request and no audit record. A tab attached to a dead daemon still counts. A failing check falls back to queueing as before. Every other response is unchanged. /rc/capabilities gains hostTerminalAlreadyMirrored. The page shows "already open on the host" for the 200 and keeps the 202 handling. Scenario P190. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DTgCRQUsB4fohqgy3VLgMH
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.
Slice C of InfiniteInsight/Qwen-Code-Remote#194: one host terminal per session.
Picking a conversation on the phone always asked the host for a terminal, and the launcher only coalesced duplicates within 12 s, so the same conversation picked twice an hour apart got two WSL tabs. The gateway now checks, before queueing, whether a live process on the host already attaches to that session (
/proc/*/cmdline, no shell, exact--attach-session <id>match) and answers200 {alreadyMirrored: true}with no request written; the page says "already open on the host". A tab attached to a daemon that died still counts as open, since slice E will make such tabs re-attach./rc/capabilitiesgainshostTerminalAlreadyMirrored. Launcher untouched.Tests: hostMirrors 10, terminals route 13, capabilities; P190 added. Focused run 36 passed, tsc clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_01DTgCRQUsB4fohqgy3VLgMH