Skip to content

fix(gateway): one host terminal per session (#194 slice C) - #176

Merged
InfiniteInsight merged 1 commit into
mainfrom
gateway/194-one-tab-per-session
Oct 29, 2026
Merged

InfiniteInsight merged 1 commit into
mainfrom
gateway/194-one-tab-per-session

Conversation

@InfiniteInsight

Copy link
Copy Markdown
Owner

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 answers 200 {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/capabilities gains hostTerminalAlreadyMirrored. 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

…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
@InfiniteInsight
InfiniteInsight merged commit a52ffa2 into main Oct 29, 2026
@InfiniteInsight
InfiniteInsight deleted the gateway/194-one-tab-per-session branch October 29, 2026 00:08
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