Skip to content

feat(runtime): run the web-only fork on Bun - #15

Merged
Igloczek merged 64 commits into
mainfrom
t3/implement-issue-12
Oct 8, 2026
Merged

Igloczek merged 64 commits into
mainfrom
t3/implement-issue-12

Conversation

@Igloczek

@Igloczek Igloczek commented Oct 7, 2026 •

Copy link
Copy Markdown

Summary

The web-only fork still required Node for its server and helpers, and default installation/update paths could select upstream releases. Bun 1.4.2 now runs the environment server and first-party helpers on macOS arm64, Linux x64, and Linux arm64. Vite+/pnpm remain contributor tooling.

- Node SEA executable + separately installed Node helpers
+ Bun executable + packaged Bun helper interpreter
- upstream release and npm defaults
+ iglo-tech/iglo.code releases and @iglo-tech/iglo-code packages

CLI bundles leave ws to Bun so upgraded Browser channels receive only WebSocket frames. Keep working Node-compatible APIs. Replace the demonstrated PTY incompatibility at its adapter, normalize SQLite boolean binds, retain a coherent Effect graph in executable builds, and preserve the Device, Browser, provider, and service boundaries.

Closes #12.

Evidence

  • CI: Check passes on latest head 590bd5f21e, including the native Bun migration documentation; the PR is conflict-free.
  • Upstream sync safeguards: the repo-local skill now records intentional fork differences covering runtime pins, executable/helper packaging, fork installation and updates, Device/remote support, plugin/workflow extensions, provider skills, automation delivery, branding, and lightweight CI. Imports must verify these even when files merge without conflicts. Skill validation, targeted formatting, and all 12 source references pass.
  • Runtime knowledge: Bun runtime boundaries records remaining native HTTP/WebSocket, SQLite, subprocess, and file-I/O candidates, why current adapters remain, and what future replacements must preserve. It distinguishes existing native-backed APIs from potential improvements and links the measurements without attributing RSS/CPU differences to an unmeasured adapter. Linked from the sync skill and Effect guidance; heap-snapshot guidance now identifies JavaScriptCore data in V8 format. This follow-up changes documentation only; skill validation, formatting, and local references pass.
  • Current main + Bun 1.4.2: merged 19e7c38cdc and retained only main’s single Linux x64 CI job. Source and rebuilt archive each pass all 9 real-client flows, authenticated transport/persistence and native/helper smoke checks. 32 helper/SSH/service tests pass, plus all 6 service cases using the actual rebuilt archive. Scoped typechecks, the web/server build, manual release smoke, and fork-pruning checks pass. The release smoke fixture now includes main’s four plugin packages; SSH and helper runtime checks reject Bun 1.4.0/1.4.1.
  • Diagnostics follow-up: Bun 1.4.2 stubs event-loop utilization and its histogram already reports lateness. The sampler now uses that supported signal, filters macOS sleep gaps, and omits false utilization zeros. Three focused regression cases pass; an actual blocked-loop probe fails before the fix and emits a warning afterward under source and compiled Bun. Server typecheck, targeted lint/format checks, and actual source transport/persistence smoke pass.
  • Before: Bun source startup failed importing node:sea; the inherited PTY package started but delivered no I/O. After: actual Bun source and extracted archive pass authenticated HTTP/OAuth/MCP/WebSocket/persistence checks and native PTY, search, keyring, ACP self-launch, and Antigravity helper smoke checks. Archive core startup runs outside the repository with no system Node/npm/Bun on PATH; helpers use its packaged interpreter.
  • Initial implementation: 439 provider replay tests passed; pinned Device tools bootstrap locally and remotely with Bun and no npm. Six source/compiled service cases, including the actual archive launcher, verify start/stop/restart, update handoff, checksum rejection, and byte-for-byte rollback against disposable state.
  • Client: 9/9 source/development-client flows and 9/9 archive/shipped-client flows pass. The shared update action covers chat/auto-balance banners and Connections settings; it has no separate command-palette or keybinding entry. Source passed when run alone after a cold Vite dependency rebuild exhausted the UI deadline during parallel checks. Fresh storage, fake providers/device host, observable milestones, and failure artifacts cover all nine required flows through development and shipped clients. One integrated T3 Browser pass verified the controlled turn, terminal, persisted settings, and copied fork update command, and a real streamed Browser page. Independent Standards and Spec reviews of the initial implementation each raised one P2; both are fixed and independently confirmed, with no outstanding findings.
  • Performance, remeasured on Bun 1.4.2: five rotating fresh launches per form, current Node main and identical code for both Bun patches. Source startup median Node 2.485 s → Bun 1.602 s; early idle RSS 411.55 → 457.80 MiB (+11.2%). Built Node bundle / actual Bun archive: startup 0.965 / 1.112 s, RSS 342.42 / 347.02 MiB, idle CPU 1.10 / 1.70%. A separate three-launch macOS footprint pass measured Node/Bun source 344.5/210.3 MiB and built forms 241.5/233.2 MiB. RSS varies with paging and collection timing; it does not establish a patch-version memory regression. The 60-second diagnostic and full-GC comparison do not show rising Bun heap in that interval; this is a small local operability sample. Full measurements, ranges, transport timings and methods.

Before:

Original manual update action

After:

Fork update command action

Bun controlled turn and terminal output

Bun server Browser stream

Merge Danger

Door: two-way

Persisted formats and wire contracts remain compatible. Application startup requires Bun on supported hosts; an installed archive supplies its own helper interpreter. Reverting the runtime changes does not require a data migration.

Blast Radius: runtime

Server startup, transports, PTYs, Device bootstrap, Browser streams, installation, and service updates. Runtime execution evidence is local macOS arm64. Current main’s lightweight CI is preserved: one standard Linux x64 Check job; additional runtime suites and release packaging run manually. Paid provider OAuth and physical simulator/device operations remain credential/SDK-dependent and are not claimed by controlled fixtures. Chromium, Git, provider prerequisites, and SDKs remain independent dependencies. Scoped web, server, and scripts typechecks pass after incorporating main’s declaration-portability fix.

Implemented with GPT-6.1-Sol through the Codex harness in T3 Code.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL labels Oct 7, 2026
Bun rejects a pending Node HTTP WebSocket handshake after Browser attachment yields to child-process I/O. Acquire the existing scoped socket before attaching the viewer, after authentication and parameter validation. An actual Bun HTTP fixture reproduces the delayed-upgrade failure and verifies the host setup close frame.
@Igloczek
Igloczek marked this pull request as ready for review October 7, 2026 16:27
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 6908a87.

This comment will update automatically after the next completed run.

Resolve CI and release conflicts around the fork’s single lightweight Check job. Preserve manual Bun archive tooling, include the new plugin manifests in its smoke fixture, and require Bun 1.4.2 locally and on SSH Device hosts.
@Igloczek
Igloczek merged commit d5cee2d into main Oct 8, 2026
1 check passed
@Igloczek
Igloczek deleted the t3/implement-issue-12 branch October 8, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run the web-only fork on Bun for macOS and Linux

1 participant