Josh Gratton 1c7e78733f feat(web): register WSL backend as a desktop-local environment
Bring up the second local backend in the renderer so its env id
appears in the saved-environment registry alongside any remote saved
envs the user paired. The sidebar, env switcher, CommandPalette, and
project-routing UI all consume that registry, so they pick up the
WSL backend without per-surface plumbing.

How the data flows:
  - On boot, runtime/service.ts calls
    reconcileLocalSecondaryEnvironments() (and again after a 5s delay
    to catch a slow WSL cold boot).
  - The reconciler reads getLocalEnvironmentBootstraps() from the
    desktop bridge. Primary stays owned by the primary/ runtime;
    everything else with a desktopLocal instance id is routed here.
  - For each new instance, the reconciler POSTs the shared bootstrap
    token to /api/auth/bootstrap/bearer on the WSL backend's URL,
    fetches the descriptor, builds a SavedEnvironmentRecord carrying
    a desktopLocal marker, upserts it into the registry, writes the
    bearer to the secret store, and triggers
    ensureSavedEnvironmentConnection.
  - Records carrying desktopLocal are filtered out of the saved-env
    persistence path, so toggling WSL off or switching distros
    doesn't leave stale entries on disk.

After-toggle wiring: ConnectionsSettings.applyWslSettingChange fires
reconcile after each setWslBackendEnabled/setWslDistro call, then
again after 1.5s for the same slow-boot reason.

Why bearer-token auth instead of cookies:
  - The WSL backend runs on its own loopback port. Cookies are
    per-origin, and the renderer's origin (the primary's URL in
    packaged builds, the vite dev server URL in dev) doesn't match
    that port, so a cookie set on the WSL origin wouldn't ride along.
  - Bearer auth uses the Authorization header which the backend's
    CORS layer already permits, and WS connections use the
    ?wsToken=... pattern that saved environments rely on. No CORS
    surgery on the backend side.
  - Auth state is per-env (a separate bearer per backend); the global
    primary auth gate in primary/auth.ts stays untouched, so the
    normal single-backend flow for non-WSL users is unaffected.

The reconciler is idempotent, dedupes concurrent calls per instance
id, and never throws — errors get logged and the caller can retry by
calling again. If the WSL backend restarts and its old bearer goes
stale, the user toggling settings re-bootstraps a fresh one.

Plumbing changes:
  - ensureSavedEnvironmentConnection exported from runtime/service
    so the reconciler can reuse the saved-env connection lifecycle
    without duplicating it.
  - New removeSavedEnvironmentByInstance variant: same teardown as
    removeSavedEnvironment but skips the secret-store delete, since
    desktopLocal entries may not own a persisted secret to remove.
2026-05-17 13:48:53 -04:00
2026-04-14 18:18:37 -07:00
2026-03-20 02:54:21 +00:00
2026-04-16 17:01:27 -07:00
2026-03-05 22:58:18 -08:00

T3 Code

T3 Code is a minimal web GUI for coding agents (currently Codex, Claude, and OpenCode, more coming soon).

Installation

Warning

T3 Code currently supports Codex, Claude, and OpenCode. Install and authenticate at least one provider before use:

  • Codex: install Codex CLI and run codex login
  • Claude: install Claude Code and run claude auth login
  • OpenCode: install OpenCode and run opencode auth login

Run without installing

npx t3

Desktop app

Install the latest version of the desktop app from GitHub Releases, or from your favorite package registry:

Windows (winget)

winget install T3Tools.T3Code

macOS (Homebrew)

brew install --cask t3-code

Arch Linux (AUR)

yay -S t3code-bin

Some notes

We are very very early in this project. Expect bugs.

We are not accepting contributions yet.

Observability guide: docs/observability.md

If you REALLY want to contribute still.... read this first

Before local development, prepare the environment and install dependencies:

# Optional: only needed if you use mise for dev tool management.
mise install
bun install .

Read CONTRIBUTING.md before opening an issue or PR.

Need support? Join the Discord.

S
Description
T3 Code fork for Android and server fixes
Readme MIT
902 MiB
0 Stars 1 Watchers 0 Forks
2026-09-20 14:36:07 +02:00
Languages
TypeScript 95.5%
MDX 2.1%
JavaScript 0.7%
Astro 0.3%
CSS 0.3%
Other 0.9%