Commit Graph
22 Commits
Author SHA1 Message Date
Cursor Agent 1a6b6842a7 Revert "Deduplicate desktop perf CI env configuration"
This reverts commit d5cba5a7c7.
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 0542b8ec9d Deduplicate desktop perf CI env configuration
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge ef95679c69 Set explicit keypress perf thresholds in CI
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge f0c533459c Add optional renderer fallback coverage and CI env docs
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 0a733fee1d Expand benchmark sweep toggle tests and CI docs
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge c3b547502b Add CI toggle to skip benchmark thread sweep
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge edd758dd0b Disable optional renderer perf interactions in CI
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 142ce0fdcf Make CI perf benchmark pass count explicitly configurable
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 2b96cc2c6c Document CI terminal perf toggle rationale
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge eb20d1f5fe Disable terminal perf scripting in CI and restore strict dispatch ceiling
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:55 -08:00
Cursor AgentandJulius Marminge 9b99c9b807 Remove temporary branch-specific CI push trigger
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge a41c0ab4f8 Relax CI long-dispatch perf ceiling for desktop traces
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor AgentandJulius Marminge 42ef93adf4 Run CI workflow on desktop perf fix branch
Co-authored-by: Julius Marminge <[email protected]>
2026-02-17 19:49:54 -08:00
Cursor Agent e666957884 fix: update CI preload artifact name to .cjs and add freshness grace period for dev startup
- Update CI verification step to check preload.cjs instead of preload.js,
  matching the tsdown CJS output format.
- Add 10s grace period to bundle freshness check in dev-electron.mjs to
  avoid race condition when parallel processes write bundles before the
  script records its start time.
2026-02-17 19:49:54 -08:00
Julius Marminge 6721804b64 Enable Linux Electron sandbox override for desktop perf runs
- Set `ELECTRON_DISABLE_SANDBOX=1` in CI desktop perf trace jobs
- Auto-enable the same override in Linux `dev-electron` runs when unset
- Add sandbox-failure log hint in perf trace diagnostics
- Include `ELECTRON_DISABLE_SANDBOX` in Turbo passthrough env
2026-02-17 19:49:54 -08:00
Julius Marminge a293a010cd Harden Electron startup waits in dev and CI
- add configurable `T3CODE_ELECTRON_STARTUP_TIMEOUT_MS` to desktop startup and CI perf jobs
- replace simple TCP wait with explicit renderer host probes and clearer timeout errors
- include Electron startup timeout env in Turborepo global env passthrough
2026-02-17 19:49:54 -08:00
Julius Marminge 4622dbd5f9 Raise desktop perf timeout and long-dispatch threshold in CI
- Set `T3CODE_PERF_TIMEOUT_MS` default to 420000 in perf trace script
- Export `T3CODE_PERF_MAX_LONG_DISPATCH_COUNT=5` across CI desktop perf jobs
2026-02-17 19:49:54 -08:00
Julius Marminge 758b3e1094 Harden desktop perf CI with deps, artifacts, and timeout hints
- Install required Linux desktop runtime packages before perf trace runs
- Increase perf trace timeout in CI and always upload `/tmp/t3code-perf-artifacts`
- Add timeout failure hints and recent log-tail output to `desktop-perf-trace` errors
2026-02-17 19:49:54 -08:00
Julius Marminge 25cc139eea Handle fork PR desktop perf runs and harden trace shutdown
- Run desktop perf tests on forked pull requests without posting PR summaries
- Restrict PR summary posting to same-repo pull requests
- Add timeout-wrapped trace stop logic and guarded cleanup to avoid hangs
2026-02-17 19:49:15 -08:00
Julius Marminge a1177c736c Add desktop perf trace automation and CI reporting
- add automated Electron renderer perf tracing with seeded state and scripted UI interactions
- add `test:desktop-perf` and `test:desktop-perf:post` scripts to generate, validate, and summarize traces
- run desktop perf trace in CI and post/update PR perf summaries on pull requests
2026-02-17 19:49:15 -08:00
8ebd2479cf bring back electron (+ websocket/package changes) (#10)
* feat: scaffold apps/server package and WebSocket protocol types

- Create apps/server with package.json, tsconfig, tsup config
- Copy codexAppServerManager, providerManager, fixPath from desktop (no Electron deps)
- Add WebSocket message protocol schemas (WsRequest, WsResponse, WsPush) to @acme/contracts
- Define WS_METHODS and WS_CHANNELS constants for type-safe routing

Co-authored-by: Theo Browne <[email protected]>

* feat: implement WebSocket + HTTP server and CLI entry point

- wsServer.ts: WebSocket server routes NativeApi methods, serves static files
  - Provider events pushed to all connected clients
  - SPA fallback for client-side routing
  - Server welcome message with cwd/projectName on connect
- index.ts: CLI entry point
  - Auto-detects available port (default 3773)
  - Resolves renderer dist for static serving
  - Opens browser on startup via 'open' package
  - Graceful shutdown on SIGINT/SIGTERM

Co-authored-by: Theo Browne <[email protected]>

* feat: WebSocket transport and NativeApi implementation for browser

- wsTransport.ts: WebSocket client with request/response, push subscriptions,
  auto-reconnect with exponential backoff
- wsNativeApi.ts: Full NativeApi implementation over WebSocket transport
  - All provider methods routed through WS_METHODS
  - Provider events streamed via WS_CHANNELS.providerEvent
  - Todos/terminal/agent stubbed (not needed for web mode)
  - dialogs.pickFolder returns null (text input fallback in UI)
- session-logic.ts: readNativeApi() now auto-detects environment
  - Prefers Electron preload bridge if available (window.nativeApi)
  - Falls back to WebSocket transport for browser mode
- onServerWelcome() hook for renderer to receive cwd on connect

Co-authored-by: Theo Browne <[email protected]>

* feat: adapt renderer for browser mode

- App.tsx: Add AutoProjectBootstrap that listens for server welcome
  and auto-creates project + thread from server's cwd
- Sidebar: Conditionalize drag region (Electron only), hide Browse button in browser
- ChatView: Conditionalize drag region, adjust padding for browser
- DiffPanel: Same drag region treatment
- index.html: Update title to 'CodeThing'
- env.ts: isElectron detection utility

Co-authored-by: Theo Browne <[email protected]>

* feat: monorepo & CLI integration

- Root package.json: Add dev, dev:server, dev:web, start scripts
  - dev runs both server and renderer in parallel via turbo
  - VITE_WS_URL injected so renderer connects to server in dev mode
- turbo.json: Add WS env vars to globalEnv
- vite.config.ts: Inject VITE_WS_URL at build time for WS server discovery
- wsTransport.ts: Use VITE_WS_URL env var in dev, fall back to page URL in prod
- Server dev script: Uses tsx for direct TypeScript execution with VITE_DEV_SERVER_URL

Co-authored-by: Theo Browne <[email protected]>

* feat: remove Electron desktop app, clean up contracts and docs

- Delete apps/desktop/ entirely (replaced by apps/server)
- Remove IPC_CHANNELS constant from contracts (no longer needed)
- Keep NativeApi interface (still the renderer's API contract)
- Keep EDITORS constant (used by both server and renderer)
- Update README.md with new architecture diagram and scripts
- Update AGENTS.md with new package roles and architecture

Co-authored-by: Theo Browne <[email protected]>

* test: add WebSocket server integration tests

- Tests welcome message on connect with cwd/projectName
- Tests server.getConfig method
- Tests providers.listSessions returns empty array
- Tests error response for unknown methods
- Tests graceful handling of invalid JSON
- All 73 tests pass across 12 test files

Co-authored-by: Theo Browne <[email protected]>

* fix: address lint warnings in new files

- wsTransport.ts: Use addEventListener instead of on-function assignments
- wsServer.ts: Replace filter(Boolean).pop() with direct array access
- wsServer.test.ts: Use addEventListener for WebSocket events

Co-authored-by: Theo Browne <[email protected]>

* fix: race condition in auto-project bootstrap + cleanup

- wsNativeApi: Cache last welcome payload and replay to late subscribers.
  Fixes race where WS connect + welcome arrives before React effect fires.
- App.tsx: Add bootstrappedRef to prevent duplicate project creation,
  skip bootstrap in Electron mode
- wsTransport: Use standard import.meta.env for VITE_WS_URL access
- CLAUDE.md: Fix header (was incorrectly '# AGENTS.md')

Co-authored-by: Theo Browne <[email protected]>

* fix: use tsx command directly in server dev script

Use 'tsx src/index.ts' instead of 'node --import tsx' for simpler dev execution

Co-authored-by: Theo Browne <[email protected]>

* chore: clean up stale Electron references and config

- Remove smoke-test script (was desktop-only)
- Remove dist-electron from turbo outputs and .gitignore
- Rename ELECTRON_RENDERER_PORT → PORT in vite.config.ts
- Clean up turbo globalEnv (remove ELECTRON_RENDERER_PORT, WS_SERVER_PORT)
- Update CI workflow to use bun 1.3.9 (matches package.json engines)

Co-authored-by: Theo Browne <[email protected]>

* feat: make t3 package publishable for npx

- Remove private:true so package can be published to npm
- Add files field to limit published files to dist/
- Move @acme/contracts to devDependencies (bundled by tsup)
- Add @acme/renderer devDependency for turbo build ordering
- Add bundle-client.mjs: copies renderer build into dist/client/
- Update resolveStaticDir to check dist/client/ first (npx scenario),
  then fall back to monorepo layout (../../renderer/dist)
- Full build pipeline: contracts → renderer → server + bundle client

Co-authored-by: Theo Browne <[email protected]>

* fix tests

* turborepo and better logging

* bring back electron

* fix

* Promise catching fixes

---------

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Theo Browne <[email protected]>
2026-02-09 22:15:48 -08:00
Theo Browne 2fc9336528 more cleanup 2026-02-08 15:04:13 -08:00