# Operating two remote machines through an agent

Address: https://nowa.im/cotty/research/field-notes/2026-11-remote-spark-operations/  
Created: 2026-11-22

From 2026-11-20 to 2026-11-22, a Claude Code session on a laptop (Omarchy, the foot terminal) managed two DGX Spark machines, spark-a and spark-b, remotely through a jump host. These are first-hand observations from that session. The machine names are aliases. Each case shows something terminals lack today.

## 1. An agent drives a terminal remotely, with no way to know that a command ended or who reads input

- **Situation.** The agent used `tmux send-keys` to start a long deployment script on spark-a.
- **Problem.** A repeated send-keys was queued in the pty's input. Inside the script, an ssh running in a background process group tried to read the terminal, received SIGTTIN and was suspended. The whole script hung.
- **Handling.** The input queue was flushed by hand with `tcflush`, and the suspended ssh was killed.
- **What it shows.** An agent needs to know when a command ended, what its exit code was, which program is in the foreground and which one reads input. Pushing bytes into a pty and sleeping is not enough. This corresponds to kernel capabilities 1 and 2 in [Capabilities](https://nowa.im/cotty/product/capabilities/).

## 2. Handoff: a person's sudo is needed

- **Situation.** Turning on swap on spark-b and writing it to fstab, booting without the graphical interface, moving Tailscale from snap to deb, and changing the Tailscale port all needed sudo.
- **Handling.** The agent prepared the complete command, with backup, rollback and verification steps. The person ran it in the session with `! ssh -t ... "sudo ..."` and said "done". The agent then verified.
- **What it shows.** This is a handoff card. In its ideal form the card shows the command and its impact, the person confirms on any device and types the password once, and the result returns to the agent by itself.

## 3. Proactive finding: Tailscale always used the relay

- **Symptom.** The laptop reached spark-a only through a DERP relay, with high latency.
- **Diagnosis.** It crossed several machines.
  - The NAT on both sides preserved ports and mapped independently of the destination, which makes hole punching easy.
  - But every node in the office used the default port 41641. office-a already held the external 41641, so spark-a got a different port and the peer could not reach it.
- **Fix.** spark-a was changed to 41642 and connected directly at once.
- **What it shows.** This is a proposal card: a proactive agent should find it, prepare the plan, and need one approval, because of sudo. office-b and office-c have the same problem, and one card could handle them as a batch.

## 4. Long tasks and grants

- **Situation.** DeepSeek V4.1-Flash ran with tensor parallelism across the two Sparks. One start took about 28 minutes. When memory fell close to zero, memguard killed the container.
- **Handling.** The agent wrote a cron guard script with:
  - a health check;
  - a grace period of 45 minutes after a start;
  - backoff after a failure, and giving up after 3 failures;
  - a distinction between "someone stopped it on purpose" and "it must be brought up after a reboot".
- **What it shows.** This is in essence a grant: the agent may restart automatically within a clear scope, and stops and asks a person beyond it. If it could be set, viewed and revoked in a card, the rules would not be hidden in a script.

## 5. Poor network: in-flight Wi-Fi

- **Symptom.** On an in-flight Wi-Fi network the round trip to the outside was about 940 ms and each website took 8 to 13 seconds. UDP 443 (QUIC) was blocked, so Chrome timed out on Google while other sites opened.
- **What it shows.**
  - This is where state sync in the manner of mosh, and local predictive echo, are worth the most.
  - The change of network is itself worth an environment change card: a new network was detected, these abilities are affected, and this is the suggested action.

## 6. Secrets should not enter the conversation

- **Situation.** The API key of a local model service had to be handed to other projects.
- **Handling.** The agent deliberately did not print the key. The person read it in their own terminal, without the `!` prefix, so that the key did not enter the conversation with the cloud model.
- **What it shows.** The terminal layer should guarantee this, by redacting output before it goes to a model. It should not depend on the agent remembering every time. This corresponds to kernel capability 3.
