Skip to content

Release v0.1.7 - #75

Merged
jm2 merged 39 commits into
mainfrom
release-0.1.7
Oct 28, 2026
Merged

jm2 merged 39 commits into
mainfrom
release-0.1.7

Conversation

@jm2

@jm2 jm2 commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Draft. The 0.1.7 features from the 2026-10-28 fleet review, merged together. The Windows GPU work and the release prep are still to come.

  • workspace_git: the node runs git outside the sandbox: status, sync with upstream (carrying uncommitted work), commit, and push to the agent's own branches with the host's scoped token. It refuses the default branch and force pushes, never runs hooks, and rewrites ssh remotes to https. It fixes git on Windows, where .git is read-only and sh.exe dies in the sandbox.
  • Fleet locks: fleet_lock, fleet_unlock and fleet_locks, plus swk locks. They replace "taking macmini" / "host free" chatter.
  • fleet_remind: delayed self-messages, so agents stop polling CI or sleeping inside a turn. Also swk reminders.
  • Quiet messages: a notify that never starts a turn on its own, for acks and FYIs.
  • Interrupted turns continued: after a node restart or a Codex app-server crash, once per interruption, never after an owner interrupt.
  • The approval policy is sent on turn/start only when it changes.
  • codex.session_env: set variables and prepend or append to PATH in the app-server's environment. Plus a writable per-session cache folder (XDG_CACHE_HOME, CCACHE_DIR), which fixes ccache and gh in the sandbox.
  • Fleet audit: inbox wait cap, restart race, clearer fleet errors, dev run, per-session caches #71:
    • fleet_inbox ticket waits use their wait_seconds;
    • restart waits for the old process to exit;
    • clearer hop-limit and fleet_reply errors, and replyable on inbox items;
    • swk dev run uses node.json;
    • the local API "EOF" errors fixed (a connection leak at the node's connection cap).

go test -race ./..., vet on all three OSes and fmt-check pass locally on Linux. This is the first CI run of the new git tests on Windows and macOS.

🤖 Generated with Claude Code

https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E

jm2 and others added 30 commits October 28, 2026 09:37
ErrHopLimit names the max_hops guard and says how a chain starts over.
fleet_reply to a notify (or another non-ask) says what it is and to use
fleet_send; to an answered ask, when and by whom it was answered.
fleet_inbox marks open asks to the session replyable.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
A lease table in the coordinator (in memory) replaces the messages agents
send each other to share a host's GPU, a LAN port or a test host. Leases
end at their TTL, on unlock, when the holder's session ends or is
removed, or when an owner breaks one (DELETE /v1/locks/{name}); waiters
get them in FIFO order. GET /v1/locks lists them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
An acknowledgement ("ok", "host free") sent to an idle session started a
turn that resent the target's whole context only to note it. fleet_send,
the API bodies and swk msg/send take quiet: the node steers such a
message into a running turn as usual, but keeps it queued while the
session is idle, until a turn starts for another message (or a person
promotes it). It still expires. A batch always holds the message that
started it; a session with only quiet messages queued settles and is
left alone by the stall sweep. The header says quiet=1 and that no
answer is needed, and the MCP instructions tell agents to send
acknowledgements quiet and never to reply just to acknowledge.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
codex.session_env in node.json sets variables (set) and adds PATH
directories (path_prepend, path_append) for the commands Codex sessions
run. The node applies it to the environment it starts app-server with,
and Codex's default shell_environment_policy (inherit = "all") passes it
on, with Codex's own per-launch PATH entries still added. PATH is the
node's (the service's login-shell PATH), under the node's spelling of the
name ("Path" on Windows), with the OS list separator.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
swk locks lists the fleet's resource locks and swk locks break ends one.
Tests cover acquire, busy, renew and release, expiry, FIFO waits, release
when a session stops or is removed, limits, the HTTP API with its owner
check, and the MCP tools.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
… connections

fleet_inbox with a ticket ran under the 3-minute call timeout and failed
with "context deadline exceeded" on longer waits. It now gets its wait
(at most 1800 s) plus a margin, and an ask still unanswered when the wait
ends is reported as pending, not as an error.

Every call to the node's local API made its own http.Transport and left
its connection idle until the node's 2-minute idle timeout, so a busy host
could fill the node's 512-connection cap: the cap closes new connections
at once, and each call then failed with "cannot reach the swk node: EOF"
through all of its retries (the antec failures took 15.5 s each, exactly
the retry backoff). swk mcp now uses one client with keep-alives off. The
node logs failed local API requests, refused connections and http.Server
errors.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
On Windows, stop now returns only once the old process has exited (its
run lock is free), not when its status file is gone or stale, so restart
cannot start the new one while the old one is still shutting down; it
used to fail with "already running" and the node stayed down. If the
process outlives ending its task, stop says so instead of succeeding.

On every OS the node and coordinator also wait up to 45 s at startup
for a lock holder to exit (runstatus.LockWait), covering launchd and
systemd restarts and any other launcher.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
swk dev run started app-server without codex.args or codex.config (or
codex.lean, the Windows sandbox default, permissions, bin, home), so it
tested a different sandbox than the node's sessions get. node.CodexOptions
now builds those options for both the node and dev run; dev run says
which node.json it used, and takes -node-dir and -no-node-config. The
-codex-* flags still override.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
A local op of the node's API ("git"), not forwarded to the coordinator:
status, sync (fetch, then fast-forward or rebase onto the upstream or the
remote's default branch, carrying uncommitted and untracked work through a
stash-like commit and a patch under the node's directory), commit (with an
optional new branch and a safe default author), push (never main, master,
the remote's default branch or forced; needs git.gh_config_dir in
node.json) and branch_delete.

The repository must be the one the session's cwd is in, with a real .git
directory or a normal linked worktree's .git file. git runs with GIT_DIR
and GIT_WORK_TREE set, hooks pointed at an empty directory, fsmonitor,
askpass, editors, signing and credential helpers overridden, https as the
only protocol, and a repository whose config includes files or names
filter, merge or diff drivers is refused.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
Inside Codex's sandbox ~/.cache is not writable, so ccache and gh fail.
Each Codex session now gets <user cache dir>/switchworks/session-cache/
<session id> (0700; session_cache.dir moves the root, session_cache
.disabled turns it off). The codex adapter makes it writable for that
thread only, through per-thread config overrides in thread/start and
thread/resume: a write entry in the permission profile's filesystem
table, or the legacy writable_roots plus the directory (the override
replaces the array, so the node carries the roots codex.config,
codex.args or config.toml give). XDG_CACHE_HOME and CCACHE_DIR point at
it unless codex.config, codex.args, codex.session_env or config.toml
set them. Another session cannot write it. It is kept across node
restarts and removed when the session stops, fails to start or is
forgotten; a node start sweeps those of sessions it no longer has.

Checked against real codex 0.163 on Linux, legacy and profile
(SWK_CODEX_IT=1 TestRealCodexSessionCache): a session writes its own
directory, not another's, and sees codex.session_env.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
Agents' clones often have git@github.com: remotes on hosts with no ssh key
(antec-win). workspace_git's own git now gets
url.https://github.com/.insteadOf for git@github.com: and
ssh://git@github.com/ on its command line, for fetch, sync and push, so
they go over https with the agent token; the repository's config is not
changed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
A reminder is a pending system message from swk to the session that set
it, with NotBefore at its due time, so the router loop delivers it then
and the store keeps it across a restart. One pending reminder per id per
session (a new one supersedes it), at most 32 per session; cancel by id.
A session that stops or goes expires its pending reminders, including at
startup for one that ended while the coordinator was down.
GET /v1/sessions/{id}/reminders lists them (read); an owner can cancel
one with POST /v1/sessions/{id}/reminders/{rid}/cancel.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
The tool goes to the node's local git op (not the coordinator), with a
10-minute limit of its own. Its description and the server instructions
tell agents to sync before starting work and whenever main moved, and to
commit and push through it when shell git fails, and always on Windows.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
The tool forwards {in_seconds, text, id} or {cancel} to the node's new
remind op. The server instructions now tell agents not to poll or sleep
in a turn for slow things (CI, builds, people) but to set a fleet_remind
and end the turn, to ask people with fleet_ask wait_seconds 0 and carry
on, and to keep acknowledgements quiet (mentioning fleet_send's quiet
option where it is offered). fleet_ask's description says the same for
asks to people.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
A turn running when the node went down (an upgrade, a reboot) was
recorded by Codex as interrupted and nothing continued it: a session
could sit idle for hours until its owner prompted it. The node now saves
the running turn in state.json as it starts and clears it as it ends or
as a person interrupts it (a turn ending because the node shuts down
stays saved). After resuming such a session it queues one system
message that starts a new turn, telling the agent its previous turn was
cut off and to check what it was running. Not for stopped sessions or a
turn the harness still runs; "continue_interrupted": false in node.json
turns it off.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
Every turn/start carried the session's approval policy. app-server
applies any turn/start override as a thread settings update and records
thread_settings_applied for it, so each turn churned the thread's
settings for nothing. The handle now tracks the policy the thread has
(as thread/start or thread/resume reports it, or as the last turn that
carried one set it) and sends it only with the first turn after a
change. The fake app-server keeps each thread's policy and reports the
turn's override, so tests check it is not resent.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
docs/harnesses.md explains codex.session_env (the Windows git
OpenSSL and PATH examples, why PATH goes in app-server's environment
and not shell_environment_policy.set, what inherit = core/none and the
default excludes drop) and the session cache directories (how each is
made writable under a profile and under the legacy sandbox, which
variables are left alone, lifecycle, where not to put the root).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
swk reminders <session> lists what a session set itself with
fleet_remind (id, due time, its text); swk reminders cancel <session>
<id> cancels one, for owners. apiclient gains Reminders and
CancelReminder.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
…tems

A branch MAIN next to main is the same loose ref file on Windows and macOS.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
The parts of a Windows GPU run that do not depend on the OS: request
validation, the working directory and workspace checks, which paths in the
workspace stay read-only (.git) or hidden (the deny list), the AppContainer
name, the fixed environment, the command line, output capture and the
per-object DACL plan for the container's SID.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
When app-server exits under a running turn while the node keeps
running, the adapter fails the turn, restarts app-server and resumes the
thread, but nothing continued the turn. The adapter now marks such a
turn.completed harness_exited; the node keeps the turn saved and, once
the restarted harness reports the session resumed, queues the same
once-per-interruption system message ("was cut off when Codex
restarted"), under continue_interrupted. A turn its owner interrupted
is not continued. Tested with the fake app-server crashing mid-turn.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
Windows only. The run gets an AppContainer per workspace (no network
unless asked: no loopback either), on winsta0\default, suspended until it
is in a kill-on-close job with UI limits (no other processes' windows, no
clipboard, no desktop switching, no logoff). Only its three standard
handles are inherited; stdout and stderr are captured (last 64 KiB each).
The time limit and cancellation end the whole job, as does the first
process exiting.

The container reaches the workspace through explicit ACEs that the node
sets on each entry through its own handle (SetKernelObjectSecurity, which
does not propagate), after checking by that handle that the entry is not a
link or a hard-linked file and that its final path is the one walked to.
Windows' own propagation goes by path and could follow a planted junction
out of the workspace. Every .git gets read-only ACEs (deny change, delete,
rename and ACL edits) and the deny list's entries in the workspace a full
deny; a link where one of those should be refuses the run.

The Windows tests run cmd.exe in the container and check that it writes
the workspace, but cannot write or rename .git, read a hidden file, read or
write the owner's temp directory or see the node's environment, and that
timeouts and cancellation kill it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
Conflicts kept both sides: lock and remind ops, wire constants, localOps,
fleet types and docs; failAsksTo releases locks and drops reminders; the
MCP instructions append waitInstructions and lockInstructions.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
Kept both CHANGELOG entries and the quiet field in the messages API row.
The quiet-ack guidance moved from the base instructions into
waitInstructions so it is said once, next to waiting with fleet_remind
and before the fleet_lock guidance; dropped the "host free" example now
that fleet_lock replaces those notes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
node: CodexOptions (shared with swk dev run) now also sets the
codex.session_env environment and the session cache settings, so
HarnessOptions keeps using it. codextest: keep the approval policy and
thread config maps, POLICY with its override and THREADCONFIG.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
Kept workspace_git beside the remind and lock tools (tool list, call
switch, docs table, CHANGELOG, TestProtocol's tool set). Its git
paragraph is now gitInstructions, appended after the wait and lock
guidance so it stays a paragraph of its own. The local API's git op uses
audit-fixes' n.writeLocal(w, r, ...), and the git test fixture gets a
logf, which writeLocal now needs for non-200 answers.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
POST /v1/gpu/run on the local API, with the session's credential, runs a
command through gpurun on the interactive desktop. Off unless node.json
sets gpu_run.enabled; gpu_run.network gives runs the client network and
gpu_run.max_seconds caps the time limit (at most 30 minutes, under the MCP
tool timeout). The workspace is the session's pinned working directory;
a read-only session, one working in the home directory or in a denied path,
a cwd outside the workspace and a program on the deny list are refused.
Every .git and the deny list's entries in the workspace (attach policy,
Codex profile denies, attach_deny, Switchworks's own files) are protected.
One run per session at a time. The node tells `swk mcp` through
SWK_GPU_RUN when it takes runs.

handleLocal's credential check and body reading move into helpers that
both endpoints use.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

jm2 and others added 6 commits October 28, 2026 10:02
`swk mcp` offers gpu_run when the node sets SWK_GPU_RUN, sends the run to
the node's /v1/gpu/run once (never retried: the command may have run) and
gives the model the exit code (in hex for NTSTATUS codes) and the kept end
of stdout and stderr. The tool tells agents to use it rather than starting
programs on the desktop or simulating input.

Docs: what a run can and cannot reach, what it still allows (windows on
the owner's screen, a likely screen read, what all AppContainers can
read, the GPU driver), and why: Codex 0.156 removed
windows.sandbox_private_desktop (openai/codex#46554).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
Closing an os.File waits for a read in progress, so the deferred Close
could hang a run whose output outlived the 10 s wait. Each copy now
closes its own pipe. Docs: how to remove the container's ACEs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
- The workspace's final path must be the one checked, so a junction on
  the way cannot point the grant somewhere else.
- Refuse workspaces that are volume roots or sit in or above Windows,
  Program Files, ProgramData or the AppContainer folders.
- Programs must be in the workspace or the Windows and Program Files
  folders, checked by their real path: Windows opens the executable with
  the node's token, so a run could otherwise start (and read) any
  program in the owner's profile.
- A wanted deny ACE must come first for a DACL to count as done, so an
  earlier allow for all AppContainers cannot precede it.
- A file that became a hard link loses the container's explicit ACEs.
- ResumeThread's failure value is a 32-bit -1.
- Tail.String takes the lock.
- gpu_run.network gives internetClient only, not the LAN.
- The Windows test also checks the run cannot change .git's ACL.

Docs: the new refusals, hard links, the UI-limit suspect, and what to
verify on a real host.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
local.go takes windows-gpu's split of handleLocal (localSession,
readLocalBody, forwardLocal) with audit-fixes' n.writeLocal(w, r, ...)
everywhere, gpu.go included; readLocalBody became a Node method so its
failures are logged too. handleLocal still maps workspace_git's op, and
forwardLocal runs it on the node. Config has both gpu_run and git; MCP
keeps fleet_remind, workspace_git and gpu_run (offered only when the node
takes GPU runs), and the tests check the exact base tool set with
gpu_run absent by default and added when on. Docs, README and
CHANGELOG keep both sides; the GPU entry is rewrapped to 100 columns.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
@jm2 jm2 changed the title 0.1.7: workspace_git, locks, reminders, quiet messages, resume, session env, #71 Release v0.1.7 Oct 28, 2026
jm2 and others added 2 commits October 28, 2026 10:24
gpuPlan resolves the workspace with EvalSymlinks but compared it with the
home directory, the deny list and the system directories as given. On
macOS the temp and home folders under /var resolve to /private/var, and
on a Windows runner TEMP's short name (RUNNER~1) expands, so the
"workspace holds your home directory" check missed and, by the same
cause, deny-list entries in the workspace (credential paths under home)
went unprotected and the program-directory check could refuse system
programs. They are now resolved the same way (gpurun.RealPath, which
also resolves paths that do not exist yet through their deepest existing
directory). The node test reproduces it on Linux with HOME through a
symlink.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
0.1.6 stopped a steer into a running turn from raising its hop count, so
two agents steering into each other's running turns could loop past a
max_hops the owner set (CI caught it in TestFleetHopLimit). Steers count
again; a person's message still starts the count over, and max_hops
stays off by default.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014qnwKGwN7T7u75n1Rymh8E
@jm2
jm2 marked this pull request as ready for review October 28, 2026 14:35
@jm2
jm2 merged commit a58720e into main Oct 28, 2026
21 checks passed
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