- All of
bun fmt,bun lint, andbun typecheckmust pass before considering tasks completed. - NEVER run
bun test. Always usebun run test(runs Vitest).
T3 Code is a minimal web GUI for using coding agents like Codex and Claude.
This repository is a VERY EARLY WIP. Proposing sweeping changes that improve long-term maintainability is encouraged.
- Performance first.
- Reliability first.
- Keep behavior predictable under load and during failures (session restarts, reconnects, partial streams).
If a tradeoff is required, choose correctness and robustness over short-term convenience.
Long term maintainability is a core priority. If you add new functionality, first check if there is shared logic that can be extracted to a separate module. Duplicate logic across multiple files is a code smell and should be avoided. Don't be afraid to change existing code. Don't take shortcuts by just adding local logic to solve a problem.
apps/server: Node.js WebSocket server. Wraps Codex app-server (JSON-RPC over stdio), serves the React web app, and manages provider sessions.apps/web: React/Vite UI. Owns session UX, conversation/event rendering, and client-side state. Connects to the server via WebSocket.packages/contracts: Shared effect/Schema schemas and TypeScript contracts for provider events, WebSocket protocol, and model/session types. Keep this package schema-only — no runtime logic.packages/shared: Shared runtime utilities consumed by both server and web. Uses explicit subpath exports (e.g.@t3tools/shared/git) — no barrel index.
T3 Code is currently Codex-first. The server starts codex app-server (JSON-RPC over stdio) per provider session, then streams structured events to the browser through WebSocket push messages.
How we use it in this codebase:
- Session startup/resume and turn lifecycle are brokered in
apps/server/src/codexAppServerManager.ts. - Provider dispatch and thread event logging are coordinated in
apps/server/src/providerManager.ts. - WebSocket server routes NativeApi methods in
apps/server/src/wsServer.ts. - Web app consumes orchestration domain events via WebSocket push on channel
orchestration.domainEvent(provider runtime activity is projected into orchestration events server-side).
Docs:
- Codex App Server docs: https://developers.openai.com/codex/sdk/#app-server
- Open-source Codex repo: https://github.com/openai/codex
- Codex-Monitor (Tauri, feature-complete, strong reference implementation): https://github.com/Dimillian/CodexMonitor
Use these as implementation references when designing protocol handling, UX flows, and operational safeguards.
This repo (t3code-kiro) is a fork of pingdotgg/t3code that patches a Kiro ACP provider on top of upstream. Before making changes that touch providers, the composer, or ACP:
- Read
PATCH.mdfor the maintenance guide (sync workflow, conflict zones, verification checklist). - Read
docs/KIRO.mdfor Kiro ACP protocol notes (OIDC auth, in-sessionsession/set_model/session/set_modeswitching,_kiro.dev/*ext methods, agent discovery). - Adding a new provider requires updating four hardcoded
ProviderKindarrays inapps/web/src/composerDraftStore.ts— see "Hidden Traps" inPATCH.md. Missing one produces a silent no-op (model selection reverts in UI with no error). - Kiro's model and agent switch in-session via
session/set_modelandsession/set_modeRPCs — no respawn. Do not pass--modelat spawn time (it locks Kiro's model and makes subsequent set_model RPCs silent no-ops). Passing--agentat spawn is safe. - Kiro's Plan sidebar wiring lives in
apps/server/src/provider/acp/KiroAcpExtension.ts. Two sources feedturn.plan.updatedvia one emitter with per-turn dedup: native ACPkind: "plan"+todo_listtool-call state machine (createseeds,completeflips; 1-based string IDs match Kiro'scompleted_task_idsconvention). Seedocs/KIRO.md→ "Plan Sidebar Wiring" for state-model details.