Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
f117561
feat(runtime): run the server and first-party helpers with Bun
Igloczek Oct 7, 2026
dff9ad6
feat(runtime): integrate Bun runtime foundation
Igloczek Oct 7, 2026
2d1fa90
feat(distribution): package Bun executables and fork releases
Igloczek Oct 7, 2026
5770924
Merge branch 't3/implement-issue-12' into impl/bun-distribution
Igloczek Oct 7, 2026
94b9306
fix(distribution): resolve disk packages in Bun executables
Igloczek Oct 7, 2026
24fc526
fix(runtime): preserve Bun helper service dependencies
Igloczek Oct 7, 2026
529b6a5
feat(device): run pinned tools and SSH bootstrap with Bun
Igloczek Oct 7, 2026
268031e
fix(distribution): publish packages under the fork namespace
Igloczek Oct 7, 2026
a548ee1
fix(releases): explain unsupported targets and missing fork assets
Igloczek Oct 7, 2026
33a4b5a
test(web): exercise Bun environments through a real client
Igloczek Oct 7, 2026
419f26d
Merge branch 'impl/bun-device' into t3/implement-issue-12
Igloczek Oct 7, 2026
6d1d20f
Merge branch 'impl/bun-distribution' into t3/implement-issue-12
Igloczek Oct 7, 2026
4621a67
Merge branch 'impl/bun-web' into t3/implement-issue-12
Igloczek Oct 7, 2026
f8c441e
fix(runtime): normalize SQLite boolean bindings under Bun
Igloczek Oct 7, 2026
cca6564
test(server): verify Bun service lifecycle and rollback
Igloczek Oct 7, 2026
2aa8dc3
Merge Bun SQLite binding compatibility
Igloczek Oct 7, 2026
81898fb
Merge integration before executable build guard fix
Igloczek Oct 7, 2026
c4085bc
fix(distribution): type executable build configuration errors
Igloczek Oct 7, 2026
3e81fec
fix(test): align web regression with client protocols
Igloczek Oct 7, 2026
8dfdbee
test(server): integrate Bun service acceptance
Igloczek Oct 7, 2026
c7c86ea
fix(server): resolve packaged web client beside Bun executable
Igloczek Oct 7, 2026
5855d78
fix(distribution): remove obsolete Node PTY archive dependency
Igloczek Oct 7, 2026
ed6ce58
Merge current integration into distribution fixes
Igloczek Oct 7, 2026
52b5a57
test(web): integrate corrected Bun regression protocols
Igloczek Oct 7, 2026
63acb96
Merge web regression followup into distribution baseline
Igloczek Oct 7, 2026
cf7c94d
fix(distribution): integrate compiled client and runtime staging fixes
Igloczek Oct 7, 2026
c956ba4
Merge current Bun integration into native acceptance
Igloczek Oct 7, 2026
c47ada0
fix(terminal): use Bun PTY for reliable input and output
Igloczek Oct 7, 2026
4004719
test(runtime): verify native Bun source and archive boundaries
Igloczek Oct 7, 2026
d0d6e2b
feat(runtime): integrate Bun native PTY and artifact acceptance
Igloczek Oct 7, 2026
0b91f1b
Merge current Bun integration into ACP web fixture
Igloczek Oct 7, 2026
05e2d05
test(runtime): verify Bun source and archive application boundaries
Igloczek Oct 7, 2026
6154d91
test(runtime): integrate Bun application acceptance
Igloczek Oct 7, 2026
004366d
test(web): provide a local ACP browser sign-in fixture
Igloczek Oct 7, 2026
6b66c03
fix(test): expose the ACP wrapper and narrow auth responses
Igloczek Oct 7, 2026
823442c
test(web): integrate controlled ACP sign-in fixture
Igloczek Oct 7, 2026
7441845
Merge Bun integration for Codex probe regression
Igloczek Oct 7, 2026
32a24f9
test(web): cover Codex probes without fixture control
Igloczek Oct 7, 2026
0f6df71
test(web): keep Codex regression on the local fixture
Igloczek Oct 7, 2026
8e1e211
test(web): await observable Bun client milestones
Igloczek Oct 7, 2026
1f22585
test(web): integrate isolated Codex probe regression
Igloczek Oct 7, 2026
6e34a08
test(web): integrate observable client acceptance milestones
Igloczek Oct 7, 2026
9ee370b
chore: sync Bun implementation acceptance changes
Igloczek Oct 7, 2026
e5b75ff
fix(browser): upgrade stream before asynchronous startup
Igloczek Oct 7, 2026
cc9bf5b
fix(browser): integrate Bun stream upgrade timing
Igloczek Oct 7, 2026
8dc0be2
chore: sync Bun runtime integration
Igloczek Oct 7, 2026
d27a8bf
fix(runtime): preserve update destinations and safe release errors
Igloczek Oct 7, 2026
9d89e10
fix(runtime): integrate final review corrections
Igloczek Oct 7, 2026
7c19300
test(web): stabilize complete Bun client acceptance flows
Igloczek Oct 7, 2026
b4249e5
test(web): integrate complete Bun client acceptance
Igloczek Oct 7, 2026
6faa5b8
chore: sync Bun runtime review fixes
Igloczek Oct 7, 2026
92736ea
chore: sync integrated Bun signal handling fixes
Igloczek Oct 7, 2026
c182401
fix(browser): preserve Bun websocket shim in CLI bundles
Igloczek Oct 7, 2026
0029bc5
fix(browser): integrate Bun websocket packaging correction
Igloczek Oct 7, 2026
e9159aa
fix(test): annotate acceptance runtime boundaries
Igloczek Oct 7, 2026
f31a4b8
test(runtime): integrate external fixture diagnostics
Igloczek Oct 7, 2026
457a03b
test(web): isolate Browser fixtures across Bun restart
Igloczek Oct 7, 2026
a0750cc
Merge branch 't3/implement-issue-12' into impl/bun-acceptance
Igloczek Oct 7, 2026
6908a87
test(web): integrate isolated Browser restart fixtures
Igloczek Oct 7, 2026
f915a0e
chore: merge main and update Bun to 1.4.2
Igloczek Oct 8, 2026
859be4c
fix(test): decode raw SQLite rows before asserting values
Igloczek Oct 8, 2026
82f8b88
fix(server): preserve stall diagnostics under Bun
Igloczek Oct 8, 2026
2fdfc2e
docs(skills): preserve intentional fork differences during sync
Igloczek Oct 8, 2026
590bd5f
docs(runtime): retain native Bun migration boundaries
Igloczek Oct 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 103 additions & 19 deletions .agents/skills/sync-upstream/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: sync-upstream
description: Import T3 Code upstream changes into iglo.code while preserving fork customizations and its web-only scope. Use for upstream merges, snapshot imports, or removing restored desktop and mobile apps.
description: Import T3 Code upstream changes into iglo.code while preserving its web-only scope, Bun runtime, fork distribution, workflows, and lightweight CI. Use for upstream merges, snapshot imports, or removing restored desktop and mobile apps.
---

# Sync upstream into iglo.code
Expand All @@ -11,11 +11,87 @@ contracts, client runtime, server compatibility, CLI distribution, remote access
and the Device panel. Testing a user's mobile project and using a mobile browser
are separate features from shipping T3 Code's native clients.

## Intentional fork differences

Treat these as preservation criteria for every import, including changes that
merge without conflicts. They describe behavior to retain; reconcile upstream
improvements at the affected boundary instead of freezing an old implementation.
Change a fork decision only when the maintainer requests it. Keep this list
current when an authorized change replaces a decision.

- **Identity and repository tooling.** Keep the iglo.code name, branding, README,
repo-local skills, and fork-specific AGENTS.md guidance. Upstream attribution
and compatible internal `t3` / `@t3tools` names remain valid.
- **Bun application runtime.** The server and first-party JavaScript helpers run
on Bun. Preserve the minimum-version checks and align `.bun-version`,
[bunRuntime.ts](../../../packages/shared/src/bunRuntime.ts), the server engine,
dev/container setup, CI setup, and packaging when intentionally bumping Bun.
Read the pin from the checkout; an upstream Node pin or older Bun pin must not
downgrade it. Vite+/pnpm and their Node contributor toolchain remain separate
from the installed application's runtime.
- **Standalone distribution.** Keep Bun executable archives and the packaged
`runtime/bun` interpreter for helpers. Installed execution works without system
Node, npm, or Bun. Preserve shared source/compiled self-invocation and service
launch, update, checksum rejection, and rollback. The supported archive targets
are macOS arm64, Linux x64, and Linux arm64; expanding them is a separate request.
Keep native assets, disk-backed SDK/browser dependencies, web assets, resource
monitoring, and signing. Packaging remains available for manual use through
[CLI staging](../../../scripts/lib/cli-stage.ts) and
[manual release procedures](../../../docs/operations/release.md).
- **Bun compatibility boundaries.** Retain working Node-compatible APIs and
Effect services. Keep Bun PTY selection, SQLite boolean normalization, and
supported stall diagnostics rather than restoring Node-only assumptions.
Executable bundling preserves one shared Effect context, leaves `ws` to Bun's
compatibility module, and stages file-backed dependencies using the same
[external-package boundary](../../../scripts/lib/cli-external-packages.ts).
[Event-loop monitoring](../../../apps/server/src/observability/EventLoopMonitor.ts)
uses Bun histogram lateness and accounts for macOS sleep; stub utilization
counters cannot gate warnings. Preserve focused runtime regression fixtures.
Read [Bun runtime boundaries](../../../docs/internals/bun-runtime.md) when an
import changes platform adapters; it records native API candidates and the
constraints behind the retained compatibility APIs.
- **Fork installation and updates.** Default release downloads and lookups stay
on `iglo-tech/iglo.code`; npm launchers/packages stay under
`@iglo-tech/iglo-code`. Keep explicit mirror overrides and channel matching.
Server updates, service updates, install scripts, onboarding, and manual update
commands must agree; none silently falls back to upstream. Sources are
[release naming](../../../packages/shared/src/cliRelease.ts),
[npm packaging](../../../scripts/build-npm-platform-packages.ts), and
[the shared update action](../../../apps/web/src/components/ServerUpdateAction.tsx).
- **Device and remote features.** Retain the Device panel, local/SSH device hosts,
`expo-device-hub`, `agent-device`, provider helpers, Browser streams, and
local/remote/relay/tunnel connections. Device tool installation and execution
use the supported Bun interpreter, including remote version checks; removing
native T3 clients must not remove users' device-project support.
- **Plugin and workflow extensions.** Preserve the fork's compiled plugin host,
Reports fixture, and [workflow plugin](../../../packages/plugin-workflows/src/server.ts),
including provider/model/skill choices, parallel reviews, bounded rework,
human decisions, and durable recovery. Reconcile their contracts, migrations,
permission scopes, MCP tools, scheduler integration, and client contributions
together. Preserve private plugin state and independently built client/server
compatibility. The boundary and recovery constraints live in
[plugins.md](../../../docs/internals/plugins.md).
- **Provider skills and automation delivery.** Preserve fresh workspace-scoped
skill discovery and explicit invocation availability in the composer; see
[providerSkills.ts](../../../packages/client-runtime/src/providerSkills.ts).
Recurring thread automations keep one outstanding automatic check through
usage limits or paused queues, while explicit Run now requests remain distinct.
Retain original queued prompts and truthful queued/dispatched delivery status;
see [recurring automations](../../../docs/user/project-settings.md#recurring-automations).
- **Lightweight CI.** `.github/workflows/ci.yml` is the only workflow, with one
standard Ubuntu x64 job, branch-based cancellation, and the existing small
smoke-test set. Keep its checks and use the repository Bun pin. Remove other
imported workflows, including releases, deployments, previews, bots, Windows
lanes, and runtime matrices. Retained packaging and runtime suites run manually;
importing upstream is not a request to restore removed CI checks.

## Import upstream changes

For a removal-only request, skip importing and go straight to pruning.

Read the working tree status and the fork's README and AGENTS.md before importing.
Inspect the implementation of each fork difference touched by the incoming diff
and record its pre-import behavior in temporary notes outside the worktree.
Preserve local work and fork customizations. Fetch the configured `upstream` remote
and use the requested revision, or its default branch when none was specified.
Prefer an ordinary merge; desktop and mobile modify/delete conflicts are resolved
Expand All @@ -25,7 +101,7 @@ reapplying the fork's changes, rather than choosing one entire side.
Git history is optional for this fork. When a snapshot import makes an update
simpler, stage upstream in a temporary directory and compare it with the fork
before copying. Preserve fork additions and customizations, including this skill,
the CLI packaging helpers and workflow, README, and the fork scope in AGENTS.md.
the intentional differences above, README, and the fork scope in AGENTS.md.
Account for upstream deletions as well as additions. Keep `.git`, dependencies,
generated output, credentials, and T3 state outside the copy. A snapshot is an
alternative import method, not permission to overwrite unrelated local work.
Expand All @@ -47,10 +123,11 @@ python3 -B .agents/skills/sync-upstream/scripts/remove_native_apps.py

The helper needs only Python's standard library and can run before dependency
installation. It removes both app trees, their native tools, workflows, patches,
dependency configuration, and known workspace hooks. It also converts upstream's
combined desktop/CLI release jobs to CLI-only builds. It is safe to rerun. It
drops obsolete native app lockfile importers so pnpm can read the remaining
catalog references; the package manager regenerates the graph.
dependency configuration, and known workspace hooks. It rewrites known combined
desktop/CLI packaging integrations; apply the CI policy above to any remaining
workflows. It is safe to rerun. It drops obsolete native app lockfile importers
so pnpm can read the remaining catalog references; the package manager regenerates
the graph.

Audit newly imported integrations; the helper covers the known upstream layout.
Search for active hooks and contradictory guidance:
Expand All @@ -67,15 +144,10 @@ entries, broken links, and instructions to implement or test the removed apps.
Adapt the helper when upstream adds a native-only integration. Keep the web-only
scope prominent in AGENTS.md and review user and developer guidance.

Desktop packaging can contain helpers or jobs also used by the server release.
Move shared helpers into CLI tooling before deleting their desktop module; retain
the standalone archives, npm packages, signing, resource monitor, and web build.
The fork keeps packaging helpers in `scripts/lib/cli-stage.ts`. Reconcile upstream
improvements there when packaging changes; the pruning helper only rewrites known imports.
Preserve the fork's lightweight CI: `.github/workflows/ci.yml` is the only workflow,
with one standard Ubuntu x64 job, branch-based cancellation, and a small smoke-test set.
Remove other imported workflows, including releases, deployments, previews, bots,
and Windows lanes. Packaging helpers remain available for manual use.
Desktop packaging can contain helpers also used by the server release. Move those
into CLI tooling before deleting their desktop module. Reconcile upstream
improvements with the standalone distribution above; the pruning helper only
rewrites known imports and does not preserve all fork customizations automatically.
Retain shared implementation code even if it includes desktop/mobile adapters or
comments. Preserve remote access, mobile browsers, and users' device projects.

Expand All @@ -97,12 +169,24 @@ Run the helper again and confirm it reports no changes. Run its focused tests:
python3 -B .agents/skills/sync-upstream/scripts/test_remove_native_apps.py
```

Review the final diff against the intentional fork differences, including files
that merged automatically. Confirm only the existing CI workflow/job/check scope
remains. For each affected difference, compare its behavior with the pre-import
notes and run the smallest relevant proof. Changes to runtime launch, helper
execution, or packaging need source and actual standalone archive smoke checks;
a source-only pass cannot prove packaged helper execution or bundled dependency
boundaries. Preserve the focused tests and fixtures that exercise those paths.

Check affected tooling with targeted lint, package typechecks, and tests. Exercise
release-smoke and CLI staging when packaging changes. Verify that release job
dependencies, reusable-workflow inputs, and artifact paths still agree. Follow
AGENTS.md for verification scope and browser consent.
release-smoke and CLI staging when packaging changes, and keep artifact names and
paths aligned across manual build, installation, and update tools. Bun version or
performance-sensitive changes also need fresh startup, idle CPU, and memory
measurements under comparable source/built forms; distinguish RSS from platform
footprint and avoid treating one sample or forced GC as normal memory usage.
Follow AGENTS.md for verification scope and browser consent.

Finish when both native apps and their active hooks are absent, the lockfile
matches the remaining workspace, and fork customizations survive. Report the
imported upstream revision (when applicable), checks, and unresolved conflicts.
imported upstream revision (when applicable), checks, affected fork differences
preserved, and unresolved conflicts.
Commit, push, and PR creation follow the user's request and repository instructions.
1 change: 1 addition & 0 deletions .bun-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.4.2
6 changes: 3 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Dev container for T3 Code. Mirrors CI (ubuntu-24.04, Node 24, Rust stable)
// Dev container for T3 Code. Mirrors CI (ubuntu-24.04, Bun runtime, Node 24 tooling, Rust stable)
// and the canonical setup in docs/operations/development.md: global `vp`, `vp i`.
// Contributor doc: docs/internals/devcontainer.md
{
"name": "T3 Code",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
"features": {
// nodeGypDependencies (default true) brings python3/make/g++, which Linux
// needs for node-pty's node-gyp fallback (its prebuilds are mac/win only).
// Node serves the Vite+/pnpm toolchain; native dependencies may need
// the feature's default Python/make/C++ build tools.
"ghcr.io/devcontainers/features/node:2": {
"version": "24"
},
Expand Down
7 changes: 7 additions & 0 deletions .devcontainer/on-create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ rm -f "$installer"
test -x "$VP_BIN_DIR/vp"
sudo ln -sf "$VP_BIN_DIR/vp" /usr/local/bin/vp

# Install the same application runtime used by source and release checks.
bun_version=$(cat .bun-version)
curl -fsSL https://bun.com/install -o "$installer"
bash "$installer" "bun-v$bun_version"
rm -f "$installer"
sudo ln -sf "$HOME/.bun/bin/bun" /usr/local/bin/bun

# First-run terminal notice, rendered by the devcontainers base image.
sudo mkdir -p /usr/local/etc/vscode-dev-containers
sudo tee /usr/local/etc/vscode-dev-containers/first-run-notice.txt >/dev/null <<'EOF'
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/update-content.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ for dir in "$HOME/.cache" "$HOME/.cache/pnpm" node_modules; do
done

CI=true vp i
node apps/web/scripts/warm-dep-cache.ts
bun apps/web/scripts/warm-dep-cache.ts
2 changes: 1 addition & 1 deletion .github/triage/PLAYBOOK.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Diagnosis grounded in source beats guessing.
First establish the shape of the install, because the same symptom points at
different code depending on it:

- How is T3 Code running on this machine: `npx t3 serve` in a terminal, the
- How is T3 Code running on this machine: `t3 serve` in a terminal, the
background service, or the desktop app?
- Which surface is the user connecting from: the website (app.t3.codes), the
desktop app against a local server, the desktop app against a remote server,
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ jobs:
exit 1
fi

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version-file: .bun-version

- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
Expand Down
17 changes: 8 additions & 9 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/pingdotgg/t3code",
"url": "https://github.com/iglo-tech/iglo.code",
"directory": "apps/server"
},
"bin": {
Expand All @@ -15,17 +15,17 @@
],
"type": "module",
"scripts": {
"dev": "node --watch src/bin.ts",
"dev": "bun --watch src/bin.ts",
"build:bundle": "vp pack",
"build:exe": "node scripts/cli.ts build-exe",
"start": "node dist/bin.mjs",
"build:exe": "bun scripts/cli.ts build-exe",
"start": "bun dist/bin.mjs",
"typecheck": "tsc --noEmit",
"test": "vp test run",
"record:codex-replay": "bun scripts/record-codex-app-server-replay-fixture.ts",
"record:claude-replay": "bun scripts/record-claude-agent-sdk-replay-fixture.ts",
"record:cursor-replay": "node --env-file-if-exists=../../.env --experimental-strip-types scripts/record-cursor-agent-sdk-replay-fixture.ts",
"record:pi-replay": "node scripts/record-pi-rpc-replay-fixture.ts",
"record:grok-replay": "node scripts/record-grok-acp-replay-fixture.ts"
"record:cursor-replay": "bun --env-file=../../.env scripts/record-cursor-agent-sdk-replay-fixture.ts",
"record:pi-replay": "bun scripts/record-pi-rpc-replay-fixture.ts",
"record:grok-replay": "bun scripts/record-grok-acp-replay-fixture.ts"
},
"dependencies": {
"@anthropic-ai/claude-agent-sdk": "^0.3.276",
Expand All @@ -42,7 +42,6 @@
"diff": "8.0.3",
"effect": "catalog:",
"jose": "catalog:",
"node-pty": "^1.2.0-beta.15",
"playwright-core": "1.60.0",
"proper-lockfile": "4.1.2",
"stream-chain": "^4.2.5",
Expand Down Expand Up @@ -70,6 +69,6 @@
"vite-plus": "catalog:"
},
"engines": {
"node": "^22.16 || ^23.11 || >=24.10"
"bun": ">=1.4.2"
}
}
4 changes: 2 additions & 2 deletions apps/server/resources/cli-entitlements.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- Same set Node.js applies to its own release binaries: V8 needs JIT
and executable memory, and the hardened runtime blocks both. -->
<!-- Bun needs JIT and executable memory, which the hardened runtime
otherwise blocks for the compiled CLI and helper interpreter. -->
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
Expand Down
Loading
Loading