Cursor Agent 0813882522 Fix event processing: decouple listener failures from dispatch, skip persistence for streaming deltas, remove unused PubSub
- Bug 1: Succeed the deferred before running listener notifications so that
  listener failures (e.g. WebSocket send errors) don't fail the caller after
  the event is already persisted and the read model updated. Listener errors
  are now caught and logged as warnings.

- Bug 2: Mark streaming text delta dispatches as transient so they update the
  in-memory read model and notify listeners but skip SQLite persistence.
  On turn completion, the accumulated message text is read from the snapshot
  and persisted as a single event, preventing unbounded event store growth
  and slow bootstrap replay.

- Bug 3: Remove readModelPubSub and eventPubSub instances that were created
  and published to but never subscribed to anywhere in the codebase.
2026-02-22 19:35:21 +00:00
2026-02-08 00:15:07 -08:00
2026-02-11 09:00:18 -08:00
2026-02-09 01:11:20 -08:00
2026-02-19 00:58:32 -08:00
2026-02-22 11:07:16 -08:00
2026-02-19 04:04:04 -08:00
2026-02-19 04:04:04 -08:00
2026-02-09 01:11:20 -08:00
2026-02-22 11:07:16 -08:00
2026-02-09 02:07:17 -08:00
2026-02-19 21:54:10 -08:00
2026-02-19 04:35:52 -08:00
2026-02-09 01:11:20 -08:00

T3 Code

T3 Code is a minimal web GUI for coding agents. Currently Codex-first, with Claude Code support coming soon.

Run npx t3 in any project directory to launch the web interface. Run bun run dev:desktop to launch the Electron desktop app in this monorepo.

Architecture

T3 Code runs as a Node.js WebSocket server that wraps codex app-server (JSON-RPC over stdio) and serves a React web app.

┌─────────────────────────────────┐
│  Browser (React + Vite)         │
│  Connected via WebSocket        │
└──────────┬──────────────────────┘
           │ ws://localhost:3773
┌──────────▼──────────────────────┐
│  apps/server (Node.js)          │
│  WebSocket + HTTP static server │
│  ProviderManager                │
│  CodexAppServerManager          │
└──────────┬──────────────────────┘
           │ JSON-RPC over stdio
┌──────────▼──────────────────────┐
│  codex app-server               │
└─────────────────────────────────┘

Workspace layout

  • /apps/server: Node.js WebSocket server. Wraps Codex app-server, serves the built web app, and opens the browser on start.
  • /apps/web: React + Vite UI. Session control, conversation, and provider event rendering. Connects to the server via WebSocket.
  • /apps/desktop: Electron shell. Spawns a desktop-scoped t3 backend process and loads the shared web app.
  • /packages/contracts: Shared Zod schemas and TypeScript contracts for provider events, WebSocket protocol, and model/session types.

Codex prerequisites

  • Install Codex CLI so codex is on your PATH.
  • Authenticate Codex before running T3 Code (for example via API key or ChatGPT auth supported by Codex).
  • T3 Code starts the server via codex app-server per session.

Quick start

# Development (with hot reload)
bun run dev

# Desktop development
bun run dev:desktop

# Desktop development on an isolated port set
T3CODE_DEV_INSTANCE=feature-xyz bun run dev:desktop

# Production
bun run build
bun run start

# Build a shareable macOS .dmg (arm64 by default)
bun run dist:desktop:dmg

# Or from any project directory after publishing:
npx t3

Scripts

  • bun run dev — Starts contracts, server, and web in turbo watch mode.
  • bun run dev:server — Starts just the WebSocket server (uses Bun TypeScript execution).
  • bun run dev:web — Starts just the Vite dev server for the web app.
  • bun run start — Runs the production server (serves built web app as static files).
  • bun run build — Builds contracts, web app, and server through Turbo.
  • bun run typecheck — Strict TypeScript checks for all packages.
  • bun run test — Runs workspace tests.
  • bun run dist:desktop:dmg — Builds a shareable macOS .dmg into ./release.
  • bun run dist:desktop:dmg:x64 — Builds an Intel macOS .dmg.

Desktop .dmg packaging notes

  • Default build is unsigned/not notarized for local sharing.
  • The DMG build uses assets/macos-icon-1024.png as the production app icon source.
  • Desktop production windows load the bundled UI from t3://app/index.html (not a 127.0.0.1 document URL).
  • Desktop packaging includes apps/server/dist (the t3 backend) and starts it on loopback with an auth token for WebSocket/API traffic.
  • Your tester can still open it on macOS by right-clicking the app and choosing Open on first launch.
  • To keep staging files for debugging package contents, run: bun run dist:desktop:dmg -- --keep-stage

Running multiple dev instances

Set T3CODE_DEV_INSTANCE to any value to deterministically shift all dev ports together.

  • Default ports: server 3773, web 5173
  • Shifted ports: base + offset (offset is hashed from T3CODE_DEV_INSTANCE)
  • Example: T3CODE_DEV_INSTANCE=branch-a bun run dev:desktop

If you want full control instead of hashing, set T3CODE_PORT_OFFSET to a numeric offset.

Runtime modes

T3 Code has a global runtime mode switch in the chat toolbar:

  • Full access (default): starts sessions with approvalPolicy: never and sandboxMode: danger-full-access.
  • Supervised: starts sessions with approvalPolicy: on-request and sandboxMode: workspace-write, then prompts in-app for command/file approvals.

Provider architecture

The web app communicates with the server via WebSocket using a simple JSON-RPC-style protocol:

  • Request/Response: { id, method, params } → { id, result } or { id, error }
  • Push events: { type: "push", channel, data } for orchestration read-model updates

Methods mirror the NativeApi interface defined in @t3tools/contracts:

  • providers.startSession, providers.sendTurn, providers.interruptTurn
  • providers.respondToRequest, providers.stopSession
  • shell.openInEditor, server.getConfig

Codex is the only implemented provider. claudeCode is reserved in contracts/UI.

CI quality gates

  • .github/workflows/ci.yml runs bun run lint, bun run typecheck, and bun run test on pull requests and pushes to main.
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%