Dev runs
When tesser dev restarts the server
tesser dev reuses the box for this worktree and service. On a box whose
server is already running, it only syncs, and prints when the server started
and that its inputs are unchanged. It starts the server again when:
- the server is not running, or its app crashed under a file watcher
- the manifest or the env changed
- a file
setupordevdepends on changed:- the env files the manifest lists
- any
package.json, lockfile, or toolchain pin such as.nvmrc - a
Dockerfileor compose file - any file the
setupcommand names - any shell script the
devcommand names (a.sh,.bashor.zshfile, or one with no extension) - every file in the manifest’s directory except
.mdfiles and the other services’ manifests
node_modules/.bin/... never forces a restart. A source file
the dev command names, such as src/server.ts in
bun --hot src/server.ts, does not count either, because the server reloads
it.
While tesser dev waits
- It prints the last line of the server’s log every 30 seconds. When the health check keeps returning the same 5xx status, the line says for how long. Each of these lines counts from when the dev run started, not from when this wait started.
- Each of those lines, and the timeout error, also shows how much CPU the
dev run’s processes use, measured every 5 seconds until the server
serves. At 10% of a core or more, the line gives the number of cores and
the program and script of the busiest process. Below 10%, it says the
processes are idle and the run is waiting on something outside them,
such as the network, the disk, a docker container, a database, a lock, or
a prompt. Work in a docker container does not count toward the run’s CPU.
When
devhas printed the same log line 3 or more times in a row and nothing listens on the first port, the line says how many times instead of showing CPU, because the run keeps retrying the same step. Raise[health] timeoutwhen the busiest process is work that finishes, such as a build, a migration, or an install, and not the dev server. - The box records when the run’s log last grew. The clock starts when the
run starts and resets when the box wakes from sleep. When the log has
printed nothing for 3 minutes, the run’s processes use less than 10% of a
core, and nothing listens on the first port, the line says the log is
quiet instead of showing CPU. What the run waits on, most often a
download, is then stuck or crawling. This applies in
setupanddev, but not whiledevwaits for a dependency to serve, and a repeated log line still takes precedence. If the wait times out this way, waiting longer will most likely not help. Restart the run instead (for example withtesser sync <box> --restart), which usually gets a stalled download through.
A service name instead of a box id
tesser status, tesser logs, tesser sync, and tesser wait take a
service name for this worktree’s box of that service.
- When the worktree has no box for it,
status,logs, andwaituse the service’s shared instance, andstatusandlogssay so on stderr. - When the service has no shared instance yet,
waituses its staged instance if exactly one is awake, launching, or waking, and says so on stderr. When none or more than one is, or the box is awake with no dev run and no sync from this laptop in flight,waitfails and names themake --ensure-runningthat finishes it. A run started from another machine that is still syncing looks the same, sowaitcan fail while that run is still going. syncnever falls back to the shared instance. It fails and suggeststesser dev <service>.- For a script,
tesser status <service> --json | jq -r .boxIdprints the box id.
Dependencies and shared instances
A dependency with nothing behind it
-
dev,make <service>, andmake --ensure-runningstill start the box, and print one line per such port on stderr: -
When this worktree has a manifest for
api, the line first namestesser dev apiin this worktree, which backs the dependency even when it starts after this box (see Your own box from the same worktree). -
When a
make api --ensure-runninghas started a new shared instance but not switched over yet, that instance is staged, and the line names it:The dependency reaches the new instance as soon as that command finishes, with no wire. If the command is no longer running, running it again with the same commit finishes the switch. -
When the port is wired to a box that is gone or has no address yet, the
line names that box instead:
-
devprints these lines when it returns: after the service is serving, or just before the error when the run fails, so they come at the end of its output. With--detach, it prints them when the box starts.tesser wait, andtesser sync --restartwithout--detach, print them when they return. Each check reads the box’s current wiring, so a port wired in the meantime is not reported. -
On the box, every connection to that port is reset. While the service runs,
the box notes the reset in the dev log (
tesser logs), at most once a minute per port. On the laptop, the request gets a 503 naming thetesser wirecommand that fixes it.
Your own box from the same worktree
-
A dependency with no wire and no shared instance reaches your own dev box
of that service from the same worktree, if one exists. The worktree is the
folder that
tesser devran in. -
Only boxes you started with
tesser devfrom your own login count. A teammate’s box, a box from another worktree, and a box started with a service-account or CI token never do. -
Your other boxes from the same worktree use this fallback too: a box made
with
tesser make, and the worktree’s workbench whiletesser exec --deps-of <service>gives it that service’s dependency ports. They reach your dev box but never back a dependency themselves, so an idle box fromtesser make apinever takes the route from the box thattesser dev apistarted. - With several such boxes, the newest one wins. Removing it moves the dependency to the next one, or to nothing.
-
A wire or a shared instance always takes precedence over this fallback.
tesser wire <box_id> api --sharedwith no shared instance running says the dependency routes to the same-worktree box instead. -
When a shared instance takes precedence over your own box of that service
from this worktree,
devsays so and prints the wire that routes the dependency to your box:If the box that depends on it started first,dev apiprints the same advice when it returns:Both lines appear only when both boxes are yours. -
devprints the fallback on stderr when it returns: -
tesser wire <box_id>lists such a dependency asapi -> <box_id> (same worktree). -
If another box from the worktree was already running when this one began
backing its dependency,
devprints: - Handing a box to another member clears its worktree, so it stops backing your other boxes.
Waking dependencies
devstarts only the requested services. It wakes the dependencies you own and the shared instances it depends on, and once its own server is ready it waits for them to serve, printing which ones it is waiting on.- If a dependency is removed, its server exits, its app crashed under a file
watcher, another process holds its port, it is still asleep after 15
seconds, or it does not come up in time,
devreports that it is not serving and finishes anyway.tesser status <box_id>shows where that box is. devnever creates missing dependencies.make --ensure-runningcreates shared instances.
A held dev
In tesser dev api web, web’s dev is held until api is healthy. The
CLI reference describes the command. These rules are the
box’s:
- web’s box holds the wait, not the command. If
tesser devstops or is killed, web’sdevstill starts on its own once api is healthy and listening on its first port. - A held run that sleeps and wakes is held again until then.
- If api’s box is removed, the wait ends and web’s
devstarts. tesser wait <box_id>on a held box names the box and port it waits on.
make --ensure-running
- It creates a box, checks out the commit, runs
setupanddev, waits for the health check, and makes the box the org’s shared instance. - With the same commit again, it does nothing and prints the same box id,
unless the shared instance is unhealthy, in which case it runs
setupanddevagain on the same box. With a new commit, it starts a new box, waits until it is healthy, switches over, and removes the old box. - After a switch, every other instance of the service, current or staged,
shows as
drainingintesser service ls. Tesser removes each draining box and its disk shortly after (see Timers), so files the app wrote only on that box, such as uploads or a SQLite file, are lost. You do not need totesser rmit. Runningmake --ensure-runningwith that box’s commit before it is removed switches back to it. - The current shared instance goes to sleep when idle like any instance box, but Tesser does not remove it for being asleep, however long it sleeps (see Timers). Once a switch moves the org to another box, it drains and is removed like any other superseded instance.
- From a worktree that already has its own box of the service, when no shared
instance runs that commit yet, that box becomes the shared instance and
keeps its warm build. This applies only when the box is the size the
manifest sets, is not kept, and has no
--sleep-afterof its own; otherwise a new box is created. The CLI resets the box to the commit, deletes files git neither tracks nor ignores (installs and build output stay), runssetupanddevagain with the org’s env values, waits for the health check, and switches over. The box then belongs to the org, and the worktree’s nexttesser devof the service starts a new box. --restartrunssetupanddevagain on the same box even while the health check passes, for a server that is stuck but still answers it. On a staged or draining instance it fails and changes nothing, and on the current one it does not switch the org over again.- A shared instance belongs to the org, so it cannot be synced to. Its env
comes from
tesser env setand the committed files in the manifest’senv.load.
During a switch
- Both boxes run
dev: the new one from whenmakestarts it, the old one, if awake, until Tesser removes it after the switch. - Both see
TESSER_SLOT=pinned, so a queue keyed onTESSER_SLOThas workers on both commits, and the old commit can take jobs meant for the new one. Removal kills any job still running on the old box. Make jobs safe to retry and to run on either commit. - If a job’s producer and workers run on the same box, key the queue on
TESSER_BOX_IDinstead. Jobs still in the old box’s queue when it is removed never run.
tesser service show
Prints one service’s repo and, for each shared instance, the full commit sha,
the box id, and a tesser ssh command that prints the manifest it runs. That
reads the file on the box, which can differ from the copy committed at that
sha. --json prints the same as JSON.
tesser wire
- It refuses a target that is not a box in your org, has been removed, or runs a different service than the dependency names.
-
After saving, it waits until this laptop’s daemon routes the change. If the
daemon has not loaded the wire after 70 seconds, the command fails, but the
wire stays saved.
tesser daemon stopthentesser userestarts the daemon. -
A wire changes where new connections go but restarts nothing. If the box’s
server ran while the dependency had nothing behind it, its client may have
given up, and requests can hang even after the wire. Then
wireprints: -
A wire names a box. When that box is removed, Tesser clears every wire that
pointed at it, so the dependency falls back to the shared instance, or else
to your own box of that service from the same worktree. New connections
route there right away. If neither exists, nothing backs the dependency
until you wire it again.
tesser rmnames each of your boxes that lost a wire, from any worktree, and where its dependency goes now, in the same terms astesser wire <box_id>. It does not name teammates’ boxes, though their wires are cleared too. If a server’s client gave up while the dependency was down,tesser sync <box_id> --restartreconnects it. - A wire connects boxes, whichever worktree or repository they came from.
-
The panel marks a branch
custom wiringwhen a laptop port reaches a different box than the box’s own dependency on that port, and names any route that is failing. Laptop focus can override subtrees without changing wires. -
tesser devreuses the box for a worktree and service, so each simultaneous frontend-plus-backend test needs its own frontend worktree. In a monorepo, run the frontend from the backend change’s worktree. - When both a dashboard and its backend depend on a third service, wire both to the copy meant for the test. Focusing the dashboard brings every reachable service to localhost, but does not fix inconsistent wiring on the boxes.
tesser exec --deps-of
The workbench gets that service’s dependency ports for as long as the command
runs. They resolve exactly as for that service’s box in this worktree, wires
included. --in <service> on its own only changes the working directory to
the service’s root.