Version 3 - #215
Closed
groundwater wants to merge 6 commits into
Closed
Conversation
groundwater
force-pushed
the
experiment/nio-http2
branch
from
April 27, 2026 23:06
e86dca4 to
f2666e2
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Deployment target: macOS 15 → 26 (project.yml, Package.swift, Makefile vtool) - Swift tools version 6.2 with strict concurrency fixes (nonisolated(unsafe) singletons, @sendable callbacks, async shutdown) - Drop KqueueVsockProbe (kqueue works with AF_VSOCK on macOS 26) - Add make debug-dmg: debug config, timestamp versioned, notarized - Sign debug dylibs in Contents/MacOS/ for notarization - cli target honors APP_SKIP_XCODE_SIGNING - Update IPSW catalog to macOS 26.4.1 (25E253) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
groundwater
force-pushed
the
experiment/nio-http2
branch
4 times, most recently
from
April 28, 2026 05:12
066986c to
0399f05
Compare
NIOVsockServer (port 5000): - HTTP/1.1 + HTTP/2 auto-detection via ProtocolDetector - StreamDispatcher routes requests synchronously (no async race) - StreamingFileReceiveHandler writes uploads directly to disk - RouterBridgeHandler bridges NIO HTTP to existing Router - allowRemoteHalfClosure for vsock connections - HTTP/2 responses omit forbidden connection header - os_log tracing throughout the pipeline HealthServer (port 5002): - Writes version JSON on connect, stays open for liveness EventPushServer (port 5003): - Tracks single client channel, pushEvent() writes NDJSON via NIO TunnelServer (port 5001): - CONNECT handshake via TunnelHandshakeHandler - Bidirectional TCP bridge via paired GlueHandler instances Shared types (VsockTypes.swift): - AF_VSOCK, sockaddr_vm, VsockServerError extracted from old VsockServer Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Guest (GhostTools): - ShellWebSocketHandler spawns PTY via forkpty, bridges I/O over WebSocket binary frames, handles resize/exit via text frames - Login shell via /usr/bin/login -fp for full environment - PTY I/O on dedicated serial queue with stale fd guard - Write retry on EAGAIN, bails out when cleanup invalidates fd Host proxy (HostAPIService): - Detects /api/v1/shell and switches to bidirectional byte bridge - Validates upgrade request forwarding, aborts on failure - Write retry on all handshake and bridge writes Client (vmctl): - WebSocket handshake, raw terminal mode, SIGWINCH/SIGINT handling - Write retry on WebSocket frames and stdout output - CPty C module exposes forkpty/openpty to Swift Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Terminal toolbar dropdown: - Open Terminal: launches Terminal.app with vmctl shell via temp script - Copy vmctl Command: copies full absolute shell-escaped path vmctl.app copied into VM bundle's Helper/ directory on launch so it has a stable known path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
New VMs use ASIF (Apple Sparse Image Format) for near-native SSD performance via diskutil image create blank --format ASIF. Migration for old VMs: - Detects raw disk format via magic bytes (DiskFormatUtilities) - Custom NSPanel prompt (avoids NSAlert SwiftUI animation crash) - NSSavePanel for destination, terminal-style progress window - diskutil image create from --format ASIF (handles sparsity) - Cancel terminates diskutil process, synchronized isCancelled - Verifies output is valid ASIF after conversion - Boot Now button with orderOut/delayed close pattern - Old VM never modified, skipHelperCopy for legacy launches - Warns that snapshots and suspend state are not migrated - GhostTools.dmg attachment non-fatal (logs error, boots without) - GhostTools.dmg uses makehybrid format for USB auto-mount Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
groundwater
force-pushed
the
experiment/nio-http2
branch
from
April 28, 2026 08:02
0399f05 to
8020851
Compare
5 tasks
Owner
Author
|
Superseded by #228. We backed out the SwiftNIO migration because non-blocking writes on macOS AF_VSOCK silently truncate large responses (~10 MiB ceiling) — see #228 description and |
5 tasks
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.
Summary
NIO migration, interactive shell, and Terminal toolbar.
NIO Migration
vmctl shell (new)
/usr/bin/login -fpfor proper environmentTerminal toolbar item (new)
Build
make debug-dmg: debug config, timestamp versioned, notarized🤖 Generated with Claude Code