Repository navigation
feat(remote): termic-server, server projects as ordinary projects, phone remote control (#82, #165) - #463
Merged
Conversation
simion
marked this pull request as draft
November 19, 2026 19:17
The sidebar row's Pin had no verb: a pinned task stays listed whatever the sidebar's filters say, and only a click could do it. `termic pin [TASK] [--off]` (MCP `task_pin`) does it through the webview like rename (`pin_task`: the store first so the row moves at once, then the file), and replies with the task and whether it is pinned. Pins by default, so a request without `pinned` pins. Protocol v26. An agent can pin the task it is waiting on, and a remote client's row menu can pin a task through the host's own verb. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL71MA4cdtDVPRN1qfy
Run agents on another machine (a Linux box, a cloud VM, a headless Mac) that keeps them running while the laptop sleeps or the network drops, and drive them from the desktop as if they were local. - termic-server: a small daemon on the box that holds the agent PTYs, reached as `ssh -T <host> termic-server bridge` with the user's own ssh, config and keys (Termic stores no credential). It listens only on a 0600 unix socket in a 0700 directory: no network port. Projects and git worktrees on the box, agents through the login shell. Unix only; the crate builds on Windows as a stub. - termic-remote: the shared wire (messages, framing), the screen reader that turns an agent's prompt into a question (Claude, Codex, Antigravity) and the transcript readers. - Settings > Servers > Add a server: a checklist that saves nothing until it passes (reach, with one sentence per ssh failure and its fix; the host key's fingerprint before Trust, a CHANGED key refused; system; install, the bundled build piped over the same ssh, no sudo, no internet on the box; connect). - The server's tasks in the sidebar; New task on <server>; a task opens as its terminal, sized to the pane (the server's PTY follows it); Rename from the row menu (a server has no pins or groups); a desktop notification when its agent asks something or finishes. - `termic --peer <server>` and MCP `peer_call` reach it when no paired computer has that name. - Release: static musl builds for Linux x86_64/aarch64 and macOS aarch64/x86_64 (signed with the Developer ID inside the app for notarization), bundled into every platform's app. - The session takes any connected transport and the server id is 32 hex, so a phone can later pair with a server directly. Tests: termic-server unit and end-to-end; remote_client unit tests (ssh failure sentences, option smuggling refused); desktop e2e against a real termic-server on the runner itself behind a stand-in for ssh (debug builds' TERMIC_SSH_BIN, e2e/fixtures/fake-ssh.sh), so CI covers servers with no box; real-box cases behind TERMIC_E2E_TEST_BOX. What is left before release (self-update, install from the box's shell, uninstall, cloning a project on the box): docs/plans/termic-server.md. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL71MA4cdtDVPRN1qfy
The desktop becomes a host for remote control, on top of termic-server: - The stream: the desktop's LAN listener answers a WebSocket at /termic-peer/v1/stream, every frame sealed with the pair key (HKDF- SHA256 per direction, ChaCha20-Poly1305, a frame that fails to open ends the connection). On only while sharing is on. - Phones: Settings > Remote > Connect a phone shows a QR code with a one-time 256-bit key, good for five minutes and one phone; every new phone raises an OS notification; unpairing cuts the live connection. The phone app lives in a separate, private repository. - Paired Termic computers' tasks in the sidebar, filed as their own sidebar files them (groups, folder colours, pins, order, PRs, tab labels), opened as their terminal, with a tab strip (agent and run tabs open remotely; a shell keeps no output for a viewer, so it shows disabled), Rename / Pin / Move to group from the row menu, and needs-you alerts. - A Stop from a phone ends the turn like a watched Escape (remote://interrupt), and transcripts for the phone's chat (Claude, Codex, Antigravity). - `--peer` between computers travels over the stream; /call is gone. docs/plans/remote-control.md replaces docs/ideas/remote-control.md. Tests: a fake phone and a fake host in e2e (node:crypto, so every pairing cross-checks seal.rs), remote_server unit tests, and the real phone app on Android against a real desktop. Refs #165 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL71MA4cdtDVPRN1qfy
A task started with a prompt (New task with a prompt, a PR review, a
race, or the phone) never pinned its Claude session to the tab: the
prompt is submitted the moment Claude reports ready, which can be inside
RESUME_FAILURE_MS, before the minted id is held for persisting, and no
later submit came to persist it. In the project checkout the chat then
could not tell its transcript apart ("cannot be identified") and the
next spawn minted a fresh session instead of resuming. Persist at the
end of the window when a submit already happened. Checked on a phone:
without this the id stayed null until a second prompt; with it the
chat loads on its own.
The transcript reader also dropped a prompt sent while Claude was mid
turn: Claude records it as a queued_command attachment, not a user
line. It reads those now, reports prompts still waiting in Claude's
queue as "queued" (enqueue / remove / dequeue, a dequeue taking the
oldest), and hides Claude's own <task-notification> lines, which went
through the same queue and showed as the person's words.
Refs #165
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Settings > Remote leads with Servers, drawn as a card: what it is and its action on top, then its machines as rows with a device tile, a status dot, a renameable name and the status under it, or a dashed placeholder when there are none. Phones share the same row. The phone app is not released, so the page no longer sells it: phones sit in one closed "Phone app · Coming soon" row that says the app is not in the stores yet, with Connect a phone as a plain button inside. It opens by itself once a phone is paired, so its owner still sees it. The page is titled Remote and its rail hint says Servers. Refs #82, #165 Co-Authored-By: Claude Opus 5.5 <[email protected]>
simion
force-pushed
the
termic-server
branch
from
November 20, 2026 16:45
8967fac to
8c4e997
Compare
… you The question patterns ran on the last 4 KB of raw output as well as on the rendered screen. Claude erases a menu it is done with (its rewind picker, a trust prompt) but the bytes stay in that tail, so "Esc to cancel" kept matching and a finished task showed the bell until enough new output pushed it out. Seen on a real box: the raw tail matched, the rendered screen showed the prompt box and no question. The patterns now run on the rendered screen only. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]>
A phone or a paired computer saw every profile's projects in one list, with nothing saying which profile they were in. Task rows now carry `profile` (slug, name, #rrggbb accent) and `project_list` names each project's profile slug, both absent on a host with no profiles, so a client can show one profile at a time in that profile's colour. Refs #165 Co-Authored-By: Claude Opus 5.5 <[email protected]>
A short height and fade (160ms) instead of a jump. Shut content still unmounts, held only for its exit animation, so the sidebar costs what it did; the wrapper is display: contents at rest and adds no box, and nothing animates on first mount or under reduced motion. Height comes from grid rows 0fr <-> 1fr, so nothing is measured. Co-Authored-By: Claude Opus 5.5 <[email protected]>
160ms on a plain ease read as a snap. iOS's sheet curve both ways, a little longer, settles instead of stopping. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Three test literals in output.rs missed the new field (e9724fe). Co-Authored-By: Claude Opus 5.5 <[email protected]>
A phone sends its APNs or FCM token over the sealed stream (`push_token`) once the person allowed notifications; the desktop keeps it on the phone's pairing and offers every OS notification it shows to `phones_push`, which targets paired phones that are not connected. The relay that holds Apple's and Google's keys does not exist yet, so `PUSH_RELAY` is None and nothing leaves the machine. docs/remote.md, "Push", lists what is left. Refs #165 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Each window pushes its folded projects, folders and task groups (its localStorage maps) on every change, the same way folder colours go; the host keeps one set per window and merges them, and task rows carry `project_collapsed` and `collapsed` on their group and folder, so a phone opens in the same shape as the desktop. Refs #165 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… on start - Done means answered and not looked at: opening its terminal (or having it open) reads it, as reading a finished task does on the desktop. Before, done stayed until the next input, whoever had looked. - Output before any input is the agent starting up, not work: clicking a stopped task no longer shows it working while Claude boots. - Output in the second after a resize is the program repainting, not work. - The question fallback reads only the bottom three lines, so an answered question a line-printing agent leaves above its next output no longer pins the task on Needs you. The end-to-end test had been passing its done checks on stale buffered snapshots; it now also checks a finish nobody watches reads done until someone opens it. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ow; Reopen starts the agent - Each profile window has its own webview, and each pushed its full agent-state map, which replaced the last one: a task running in one window read "inactive" whenever the other pushed (seen flipping idle/inactive every few seconds). The backend keeps one map per window and merges them; the window where a task runs wins, and a window silent past the staleness cutoff drops out. - A server task open in the main area un-highlights the local task row underneath (two rows read as active). - Opening a server task whose agent stopped starts it on its last session, as opening one does locally; Reopen did nothing before. Refs #82, #165 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…it open The desktop ignored term_size, so the phone drew the agent's terminal at the desktop's width (105 columns on a phone: unreadable). A phone now sizes it for its screen while it has it open, and the desktop gets its own size back when the phone closes it or goes. Offered to phones only (caps "resize"): a paired desktop has its own pane, and two desktops would fight over the size. Refs #165 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…vives its redraw The desktop told the phone about a new size only on the agent's next output, so an idle agent stayed at the desktop's width; it now answers term_size with term_resize at once. Reopening the same terminal (the phone redraws that way after a resize) keeps the phone's size instead of restoring the desktop's. Checked on an iPhone: 105 columns became 58. Refs #165 Co-Authored-By: Claude Opus 5.5 <[email protected]>
[Request interrupted by user ...] is Claude's own line after Stop, not the person's words; it showed as their message on the phone. Refs #165 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The dialog closed the path field before the list reloaded and the new project was picked, so the old one showed selected for a moment (and a quick Start went to the wrong repo). It closes once the new project is picked. The add button beside the project list has a test id, and the remote spec now runs against a box that already has projects and tasks (it clears stale phone pairings first and finds its task by name): all 15 cases pass against a real Linux box. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]>
docs/plans/server-projects.md: the desktop owns everything about a server project; termic-server only executes on the box. - Project.server (servers.json id); root_path is then a path on the box. - server_projects.rs mirrors a server's projects and tasks into the desktop's store on connect and on every change to its task list, keyed by the box's ids. The desktop's order, pins, groups, folders and names survive a resync; a task that left the box is archived, never deleted. Server projects are not config-synced. - The normal sidebar draws them. A server task's row takes its state and fade from the server (data-remote-state); opening it shows the server's terminal in the main area; New task on its project opens the server's dialog with the project picked; archive goes to the box. The per-server sidebar section is gone (paired computers keep theirs). - A server task's age seeds from when it was last opened, not "now". Also: the side-rail case clears a secrets role another spec leaves in the shared profile, and the settings rail expects Add a server on Remote. Checked: remote spec 12/12 with the stand-in box and 15/15 against a real Linux box; the full suite 52/54 before this, the other two fixed here. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the box - A server project's row in the sidebar shows the server's name and connection dot after the project name: "termic" here and "termic" on the Blackview read apart. - Task rows carry project_id and the server's name, and project_list the server's name, so a phone keeps two projects with one name apart. - `new` on a server project (from a phone, the CLI or an agent) is forwarded to the box by the project's id and the mirror brings the task into the store; before, it would have made a local worktree at a path that only exists on the box. Refs #82, #165 Co-Authored-By: Claude Opus 5.5 <[email protected]>
A phone reads the desktop's projects, so a server project's task showed up on it but as "not running" with no conversation: the desktop answered from its own (empty) view of that task. It now relays to the box: - the row's state, activity, question, tabs and age come from the server's own row; - the transcript is asked of the server; - the terminal opens on the server's stream (term_reset / term_data / term_resize / term_closed forwarded), with typing, sizing and closing going there too; - keys (bound to the question on the box's screen) and Stop are forwarded and their acks relayed. A change to a server's rows wakes the phone's state loop at once instead of on its 4s timer. Checked on an iPhone against the Blackview: a task started from the phone, its chat, its Done state and its terminal at the phone's width. Refs #82, #165 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…orgets its projects - The right panel (git, files, diff) is hidden for a server project's task: it would run git on a box path on this machine. Stage 3 brings those over the server's connection. - A server task's menu (and right-click) offers what works on it today: pin, rename, archive. The local items (terminals, scripts, sandbox, schedules, Stop) come with stages 2 and 3. - Removing a server drops its mirrored projects and their task records from this machine's store (the box keeps its worktrees). They lingered and, in the test profile, pushed the sidebar long enough to break the drag cases. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…egins)
- termic-server `exec { cwd, argv, env, stdin, timeout_ms }`: runs a
program under the login shell's PATH, only inside a registered project
or one of its worktrees (canonicalized, so `..` cannot escape), with a
timeout and capped output. The desktop answers `exec` with Unsupported:
an agent or a paired machine never runs arbitrary commands through it.
- server_projects.rs keeps an index of the folders that live on a server
(each server project's root and task worktrees), refreshed at start,
after each sync and when a server is removed.
- git_bytes, the funnel 156 git calls go through, runs a server folder's
git there: branches, status, log, diff and the rest of the git panel.
- The file tree's listing and the editor's read go to the box too, with a
relative path refused if it could climb out of the task.
Checked: termic-server's e2e (exec inside, refused at / and through
..), and the remote spec, which reads a server task's branches, status,
a listing and a file through the desktop, and refuses an escape.
Refs #82
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Its git and files come from the box now, so the panel shows again: the file tree lists the worktree on the box (its `.git`, a file in a worktree, hidden like a checkout's folder), the editor reads from there, and the Git tab's status and branches are the box's. A box has no file watcher here, so Refresh (right-refresh) reads the folder again. Checked in the remote spec: the Files tab lists a file written on the box, through the server's exec (logged during the run: every listing and git call for that task went to the server). Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Saving from the editor writes the file on the box (to a temp file, then renamed over, so a torn write never leaves half a file), fenced to the task like the read. - git_raw: git with any exit status, on the box for a server folder; the diff summary's untracked files (`diff --no-index`) and the ⌘P finder's listing use it. Stage, commit and push already went through git(). - exec_with_stdin for writes. Checked in the remote spec: a save lands in the box's worktree, and a stage + commit through the desktop is the box's newest commit. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]>
- ServerRecord.profile: the label of the window that added it. The mirror puts its projects in that profile; a server added before keeps where its projects already are. - The sidebar's projects header gets an Add a server button beside Add project, opening the same dialog. - AgentCache::update is test-only now (pushes go through update_from). - The plan says what has shipped and what is left of stages 3 and 4. Checked: remote_client and server_projects unit tests, and the remote spec (15), which opens the dialog from the new button. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n the box [skip ci] Step 3 of docs/plans/server-projects.md. TaskView draws server tasks; the desktop starts their agent and every tab through pty_spawn, with the env local spawns get (task_spawn_env) and a PtyManager slot each, so the CLI's send, wait, logs, stop and diff take the local path and only `result` still asks the box. The id on the box is a claim: `<task>:agent` for the default agent, `<task>:<tab>` for the rest, so an open of a running one attaches. A restarted desktop finds its agent still running and two desktops share one. The desktop's own id is a handle, unique per spawn (`<claim>/<hex>`, a legal event name): live output reaches every handle, an attach's backlog only the handle waiting for it, and the PTY ends with the last handle's kill, so a kill racing a respawn or a cancelled spawn never ends the running agent. A kill reports no exit to its asker. A task made by the old engine has its agent give way on first open. One top bar (sandbox and Secrets left out on a box, SSH Open with), one task menu, one Cmd+T palette whose agents come from the desktop's registry checked on the box (server_which). Cmd+W on a server task's agent tab still asks Close view / Stop agent / Cancel. The box's state reading covers a desktop-started agent for when no desktop has it open; once open, its tabs read state like local ones. The remote spec drives all of it through the normal view: the agent started on the box, CLI send and logs, files and the editor, Cmd+T, a shell that survives a dropped connection, Run, Close view, Stop and start again, Send to main, and waiting read from a hook's OSC. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…ename keeps the agent [skip ci] Step 4 of docs/plans/server-projects.md. task_host.rs carries task creation's own filesystem steps on this computer or on the box (exec), so task_create_sync and task_open_repo make a server project's task with the desktop's code: its worktree in the box's worktrees folder (the one the fence allows), the project's copied files and linked config dirs there, and the record on the box with the new task_put (plain data, starts nothing; its id field is `task`, since the request's own `id` sits beside a flattened command). The ordinary New task dialog opens for server projects, its agents the desktop's registry checked on the box, without the isolation and secrets panes; NewRemoteTaskDialog is a server's Add project only. The phone host no longer relays server terminals: their PtyManager slots are local. A rename re-ran TerminalPane's whole spawn effect (task.name was a dependency), killing and respawning the PTY: locally it restarted the agent mid-turn, which `termic rename` from inside a task did to itself, and on a server it ended the agent. The effect reads the name through a ref now. A server PTY's last handle also waits 1.5 s before the box kills it, so any re-run attaches instead. Covered: termic-server's task_put (recorded, updated, refused outside the fence, for an unknown project or a non-uuid id); the remote spec's Duplicate, base-branch and main-checkout tasks made through the dialog and found on the box, and the real-box suite rewritten for the same flow; task.e2e's rename keeping the agent's PTY. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…rver tasks get a base [skip ci] Run end to end against a real Linux box (the real-box suite, TERMIC_E2E_TEST_BOX), which found three things the local box could not: - A daemon from before `quit` refuses it, so a required upgrade installed the new build and never restarted onto it: such a box stayed on the old engine for good. restart_server (the automatic restart and Restart now alike, now the server_restart command) falls back to `termic-server stop` over the same ssh the install used; the next connection starts the new binary. - A server project is mirrored, never added here, so it had no base branch pinned and a task made by the desktop recorded none. Creation detects it on the box as project_add does, keeping only a ref that resolves there. - Send to main passed the stored base to git as-is, so "origin/main" in a repo with no remote failed; it resolves it first, as creation does. Local tasks had the same bug. The real-box suite restarts the box onto the bundled build when it is older, and opens Add project from the server's menu (a real box already has projects, so its + opens New task for one of them). Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…[skip ci] Server tasks open in TaskView now, so nothing passed taskPath any more: its shell tabs, file tabs, box agent buttons, useServerShells and useBoxAgents were unreachable. NewRemoteTaskDialog's start() lost its server branch for the same reason (a server's tasks start from NewTaskDialog; this dialog is a server's Add project only). Their locale keys go with them. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
A server agent read its state from the title and the box's floor, while the same agent here had exact hook state. The box already sets TERMIC_PTY, so only the config was missing. agent_hooks gains Target::Server: the install runs on a local staging copy of the agent's config pulled from the box over exec (a tar of the hooks file and termic-hooks/), with the box's $HOME in the command paths, and the result is pushed back. server_projects' sync does it once per run for every agent whose hooks are installed on this computer (the Docker consent rule). codex (trust needs codex app-server) and the slot agents are left for later and keep the fallback state. The local-box e2e installs claude's hooks here and checks the box's settings.json names only scripts on the box, all executable. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
… there [skip ci]
An upgrade restarts the box's daemon, which ends its PTYs. The old
daemon resumed only its own engine's agents (resume_on_boot); the ones
the desktop starts, which is every task made now, came back to the
desktop as an attach-only miss and sat on the exited banner. Every
server upgrade meant restarting each agent by hand.
`quit` records the live desktop claims (restarted_claims); the next
daemon answers an attach to one with the reason `restarted`, once. The
desktop passes it on pty-exit (`restarted`), and TerminalPane starts the
tab again, an agent resuming its session, as after an app restart.
e2e: a desktop-started agent answers, the box restarts, and the same
tab has a new PTY whose agent answers again. Control: with the pane's
respawn disabled the test fails ("the agent was not started again").
Refs #82
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…desktop's PTY [skip ci]
Step 5, first half (docs/plans/server-projects.md). termic-server kept
its own way to run agents next to the desktop's: an agent table (with
gemini), `new`, `agents`, a prompt queue, resume-on-boot. `send` to a
stopped task, or a terminal open, started a second agent from that
table next to the one the desktop runs.
Deleted: agents.rs, Live and its queue, spawn_agent, resume_after_restart,
the `new` and `agents` verbs (now `unsupported`). A task's agent is the
desktop's `<task>:agent` PTY (Daemon::agent_pty), which send, logs,
stop, keys, interrupt and the terminal act on; one that is not running
is refused ("open the task in Termic").
Found on the way, each with a test:
- Keys the desktop types never woke the monitor, so the box read a
desktop-driven turn as idle and a required upgrade could restart it
mid-turn. Enter into an agent pokes it (Rust e2e, failed before).
- After a reconnect the desktop could restart a box before the first
tasks snapshot, when an empty list meant no news (tasks_seen).
- A restart's hang-up could reach the desktop as "exited" before the
connection dropped, leaving the agent on its exited banner; nothing
is said while restarting. Timing-dependent: the Rust check did not
fail with the fix off, the remote suite went from 1 of 2 to 3 of 3.
- A new PTY or a terminal open now pokes the monitor too.
e2e: the local-box, real-box and upgrade suites make their tasks with
the desktop's New task dialog, as a user does.
Compat: no released desktop creates server tasks itself, so this box
needs the next release's desktop. REQUIRES_DESKTOP goes up at release
(release skill, "Compatibility floors").
Refs #82
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…g on the box [skip ci] The old daemon's archive ended only its own engine's agent, so every desktop-started agent and shell outlived its task: four fake agents from earlier runs were still running on the test box 80 minutes later. The new archive ends every <task>:* PTY; this pins it on a real box. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
… [skip ci] `result` for a server task was forwarded to the box, which had its own transcript reader, and the phone's chat for one read this Mac's home, where that transcript is not. task_host.rs gains home / is_file / newest_with_ext / read_to_string (exec on a box), and the desktop's claude transcript lookup goes through them for both. The forwarder and the box's `result` verb are gone. Codex and Antigravity chats for a server task say they are not shown yet (their readers take paths). e2e: a claude transcript written in the box's HOME is what `result` returns, path and text. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…skip ci] codex runs a hook only once a trust entry names it with a hash only codex computes, so the box install skipped it. Now the staged hooks are pushed first, `codex app-server` on the box is piped one initialize + hooks/list over exec (login shell PATH), and the hashes it reports go into the staged config.toml, pushed with the rest. e2e (local box, where codex is installed): codex itself, run with the box's CODEX_HOME, reports every termic hook there as trusted. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…h every desktop [skip ci] Step 5, second half (docs/plans/server-projects.md). Two desktops on one box saw the same tasks but each its own sidebar: a pin or group made on one never reached the other, and a rename only by the separate verb. Every write of a server task record that changes its organisation sends it to the box (save_task -> push_org_if_changed, task_put `org`), stamped with its write time. The box keeps `org` opaque, returns it in `list`, and puts pin, order and group in its tasks snapshot, so the change is one every connected desktop resyncs. The mirror takes the box's org only when it is newer than what this desktop last wrote or took (newer_box_org). That clock is not decoration: without it a resync already in flight when you pinned or grouped something applied the box's older record and undid it. Seen in the e2e log (group set, then reverted 8 ms later by a resync), and a full run failed on a reverted pin and rename; a unit test now pins it. e2e: this desktop's name, pin and group reach the box's record; another desktop's rename and unpin written on the box come back. 35/35 twice. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
Step 6 (docs/plans/server-projects.md). The desktop's remote_server.rs and termic-server's session.rs each had the same Out queue, behind accounting and write loop. They are termic-remote's outbox.rs now; each host only says how to build its terminal reset. The copies had drifted, which the move fixes: on the desktop a chunk dropped for being behind was still counted as queued, so the count never returned to zero, the catch-up reset never fired, and a phone's terminal stayed frozen after one burst of output. A unit test pins the count. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…rver box too [skip ci] Their install writes a second config (a status line slot, muse's managed hooks path) under the same config dir, so staging already covered it: the box install now pulls and pushes that file (slot_rel) and every agent with hooks gets them on a box. e2e: grok's hooks file and its config.toml status line on the box name the box's scripts. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…the box [skip ci] The phone's chat for a server Codex task read this Mac's ~/.codex. A script on the box does codex_rollout's lookup (the session's file, else the newest of the last 400 whose session_meta names the task's folder) and the desktop parses what it prints. Antigravity's chat is SQLite, which a box need not have; it still says so. Unit test runs the script against a fake HOME: by session, by folder past another folder's newer rollout, nothing for an unknown folder. It caught the first version searching for cwd:/path without its quotes. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…kip ci] - A local project whose path matched a server's (same user and layout on a Linux desktop and its box, a box project at ~) had its git, agents and saves sent to the box. The routing table holds local folders too and the most specific one decides. - Renaming a server project in Settings archived all its tasks: box tasks are matched by the box's project id, not the desktop's name. A project removed on the box now archives its tasks, as the comment said. - task_file_read / task_file_write / repo_config_load / repo_config_save / task_open_repo / server_remove / server_rename did an ssh round trip on the main thread; they run on spawn_blocking. - Shared organisation: a failed push is retried on the next save; no push before the first sync of a run (it would stamp stale data as new); the box's own rename stamps its time. - A box restart now restarts run tabs too, not just agents and shells. - Scripts handed to ssh run under `sh -c` (posix(), tested): a fish or csh login shell could not connect, probe or install. - Box hook staging moved from /tmp to the user's 0700 cache dir, removed after each sync; a symlinked agent config is left alone. - Closing a server terminal while offline queues the kill for the next connection instead of dropping it. - termic new / MCP task_new on a server project made the desktop's task (it was forwarded to a box that no longer creates them); --from and --pr say they are not supported there. - Trusting a host key: the key ssh records is checked against the fingerprint shown before it goes into known_hosts. - Editor and .termic.yaml saves on a box keep the file's mode and write through a symlink (BOX_WRITE_SH, tested). - termic-server: one process per claim when two opens race; the kill grace kills the whole group even if its leader exited; exec waits instead of polling every 5 ms. - Server worktree folders carry the project's short id; a failed record after create takes the worktree back; Delete branch works on archive. - A fixture named what may be a real organisation now says "work". - Leftovers removed. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…lete branch, offline kill, termic new [skip ci] Local-box cases for what only had unit tests: - renaming the server project here keeps its tasks through a resync; - an editor save on the box keeps a script's mode and a symlink; - archiving with Delete branch removes the branch on the box; - a terminal closed while the box is offline is ended when it is back (control: with the queued kills disabled it fails, "the closed terminal kept running on the box"); - termic new on a server project makes the task through the desktop, and --pr is refused there. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…ions, three pages [skip ci] "Agent access" (MCP and the CLI) and "Remote" (phones, paired computers and servers on one page) had grown where features landed. After the server refactor a server is where a project's tasks run, not something that controls this computer, so it gets its own page: - MCP & CLI: how agents on this computer drive Termic. - Remote control: what drives it over the network, phones and other computers, with the one "Share on this network" switch they share. - Servers: the SSH boxes projects run on (ServersSection, `servers` tab). The rail drops its hints (they existed for renamed labels and squeezed these to "MCP ..."), the Servers page says "Servers" once, a server's menu and the rail's server rows open Servers, and every string and error that sent people to "Agent access" or "Remote" points at the right page. The command palette's `remote` row said "Servers settings" and opened the phones page; it says Remote control, and Servers has its own row. Pair a computer is enabled when an agent can reach the other machine at all: Termic's MCP server in Claude Code or Codex, or the termic CLI on PATH (`termic --peer` needs no MCP), or another agent wired by hand. e2e: the layout test walks the three rail items and both pages (with screenshots); the rail table and the palette rows follow. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
chat_supported (cli_server.rs): Claude and Codex anywhere, Antigravity only for a local task (its log is SQLite, read only here). The phone opens every other agent on its terminal instead of a chat that cannot load, so all agents are fully driven from it. Optional on the wire; older phones ignore it. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…gravity chat on servers [skip ci] - A desktop whose `seen` is past everything a PTY wrote watched an earlier process under the claim (another desktop restarted it). The clamp skipped the new process's first bytes and garbled the screen; it now gets the whole ring. - Box terminal output is flow-controlled: past BEHIND_BYTES queued the forwarder stops queueing, remembers the offset, and sends the missed stretch from the ring once the queue drains, so a flood on a slow link no longer grows the daemon's memory. - A server Antigravity task's chat: its SQLite conversation is fetched from the box by the id its hooks reported and read on the desktop. Refs #463 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…d deleted [skip ci] What is still true moves to the reference docs: the design decisions to docs/remote.md (Servers), hooks on a box to docs/agent-hooks.md. The stage-1 line saying the desktop owns a server project's organisation was wrong since org moved onto the box; it is gone. A phone straight to a box was never approved, so it moves to docs/ideas/phone-to-server.md. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…ver [skip ci] A server holds several projects, and the server row's + (and its menu's New task...) opened New task in the first one, wherever you meant to work. Both are gone; each project row keeps its own. The Add a server dialog's "Add a project" button now opens Add project instead of New task in an existing project. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…skip ci] On Linux and Windows the X closes the window natively, so the "Quit Termic?" question for running agents came from ExitRequested, after the window was already destroyed: the app looked dead, then asked, and Cancel left a process in the tray with no window, whose Show did nothing. The last window's CloseRequested now asks first and keeps the window on Cancel, and tray Show builds the root window again if none exists. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…uter [skip ci] Most people never add one, and the empty REMOTE header sat under the projects for good. Until it has a row, its add menu (Connect a phone, Pair a computer, Add a server) is a globe in the sidebar footer; once a server or a paired computer exists, the section draws and the globe goes. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
It opened the paired-computer New task form (title "New task on <server>", a project picker, prompt and Start) with a path field on top, so it read as New task. A server now gets "Add a project on <server>": the path and Add, and it closes once the project is listed, as Add project does locally, instead of going on to New task. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
…ain folder [skip ci] The box refused it and named a CLI flag (--non-git) the dialog has no way to pass. The dialog now says what a plain folder means and offers "Add as a plain folder". The box records it (state.json `non_git`) and reports it in ProjectInfo, so the desktop's mirror marks the project non_git and its tasks run in the folder instead of asking for a worktree. Refs #82 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
simion
marked this pull request as ready for review
November 23, 2026 09:57
simion
added a commit
that referenced
this pull request
Nov 24, 2026
Remote control of Termic from anywhere you are: the Termic Remote app for iPhone and Android, other computers running Termic paired over the LAN, and agents on your own Linux or Mac machines through termic-server. One sealed stream serves all three, answers are bound to the question on screen, and one screen draws a terminal at a time. This is PR #463 together with everything that followed it on main up to v2.0.5, squashed into one commit. The individual commits are kept on the branch backup/pre-squash-2026-11-24, and the release tags v1.25.0 to v2.0.5 still point at them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo
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.
Run agents on another machine you reach over SSH (a Linux box, a cloud VM, a headless Mac mini), and drive them from the desktop as if they were local.
They keep running while the laptop sleeps or the network drops.
The same PR carries phone remote control and Termic computers driving each other.
Refs #82 (servers), refs #165 (phone remote control).
Neither closes yet: #82 also asks for remote sandboxing and 32-bit ARM boxes; the phone apps are in the stores now (Android live, iOS in review).
What the user gets
ssh.A checklist (reach, host key, system, installed, connect) saves nothing until it passes, and installs
termic-serverover the same ssh when it is missing: no sudo, no internet on the box.Names, pins, order and groups are shared through the box, so every desktop on it sees the same organisation.
termic --peer <server> ...and MCPpeer_callreach it;termic pin/ MCPtask_pin(CLI protocol 26).How it works
The desktop owns tasks.
termic-serveris a thin host on the box:exec, daemon-owned PTYs with a ring, the queued-prompt drain, a hook-OSC reader for a state with nobody attached, and the folder fence.TaskHost(task_host.rs) picks Local or Server once per operation, and a server PTY emits the samepty://events, so the task view has no remote branch.The desktop reaches the box as
ssh -T <host> termic-server bridgewith the user's own ssh; Termic stores no credential, and the daemon listens only on a 0600 unix socket.Phones and paired computers use the desktop's LAN listener, on only while sharing is on (off by default), every frame sealed with the pair key.
docs/remote.mdhas the design and the wire, including why it is shaped this way.docs/plans/termic-server.mdanddocs/plans/remote-control.mdlist what is left.Screenshots
Settings > Servers, a box connected:
Settings > Remote control:
A server task: its agent terminal, the box's files on the right:
A file on the box open in the editor:
The Add a server checklist against a Mac over ssh:
A paired computer's tasks filed as its own sidebar files them:
Review
Two adversarial reviews ran on the branch; their findings are fixed in b45fac9 and 636ca96 (reattach after another desktop restarts a PTY, back-pressure on box terminal output, Antigravity chat on servers), with tests for each.
Tests
cargo test --workspace(termic-server 17 unit + 8 e2e), vitest,npm run typecheck:e2e.TERMIC_E2E_TEST_BOX: 3 passing.Manually tested
By the maintainer, on a Termic Beta built from this branch: a Linux server connected with its repos, and the phone app paired and connected.
Not yet exercised by hand: the Settings split, the fixes in 636ca96, and starting a task from the phone's new New task sheet.
🤖 Generated with Claude Code
https://claude.ai/code/session_018opNL4DeF5MZjpvmckKSwo