- `auth pairing url` resolved the state directory with the same flag
heuristic the command exists to hide, so without --dev-url it read
`userdata` while `bun run dev` writes to `dev`. It then minted into the
wrong database and printed a URL the live server rejects with
`invalid_credential`. It now searches both state directories and issues
against whichever one the running server actually uses.
- A server killed with SIGKILL leaves `server-runtime.json` behind, and
that was taken as proof it was still up. Verify the recorded pid is
alive before minting.
- `--dry-run --share` replaced and then tore down the port's existing
tailscale mapping. Dry run now returns before the share block.
deriveServerPaths takes an optional explicit stateDir for callers that
have already located a running server and must target it exactly.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Browser dev is now single-origin: Vite proxies /api, /ws, /oauth, and
/.well-known to the backend, and dev/dev:web no longer bake
VITE_HTTP_URL/VITE_WS_URL into the bundle. Absolute localhost URLs in the
bundle sent any remote browser to its own machine, which no amount of
external path mapping could fix.
- `dev --share` publishes the web port on the tailnet and logs a pairing
URL already built against that origin
- `dev:pair` mints a pairing URL for a running server, resolving port and
state dir from server-runtime.json
- Ports derive from the worktree path, so each worktree is stable across
restarts; the availability probe is loopback-only so `tailscale serve`
can't push the port
- Web session cookies are port-scoped like desktop's, ending the
cross-instance "Invalid session token signature" loop
- Dev startup pairing tokens last 24h instead of 5m; user-issued links
keep the 5m default
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
- add structured lifecycle logs for Codex thread open/resume and provider session restarts
- introduce persistent server file logging layer and tighten WebSocket server startup/finalizer ordering
- preserve env-based boolean overrides in dev runner and stop forcing WS event logging in dev
- enrich provider session listing from persisted bindings and fix Claude rate-limit/task-id event mapping
- update orchestration and dev-runner tests for runtime-mode restart and env-flag behavior
Add tree-kill via taskkill /T /F in processRunner and codexAppServerManager so timeout enforcement and session stop properly terminate the entire process tree instead of just the cmd.exe wrapper. Detect Windows command not found (exit 9009) in normalizeExitError. Pre-validate editor commands with isCommandAvailable in open.ts before spawning. Fix ProviderHealth test import and dev-runner test path assertion for Windows.
Made-with: Cursor
- Replace string-based env override plumbing with typed config/flag parsing
- Split server/web offset resolution from explicit port/dev-url overrides
- Refactor and expand dev-runner tests around offset/env behavior
- Add `vitest` as a contracts dev dependency for test execution
- Replace `scripts/dev-runner.mjs` with typed `scripts/dev-runner.ts` in a new `@t3tools/scripts` workspace
- Move networking helpers into `@t3tools/shared/Net` and reuse them in server and desktop
- Add shared NetService tests and align workspace deps to `catalog:` versions
- Stop `findFirstAvailableOffset` only when a required port exceeds `MAX_PORT`
- Add test covering offsets where only non-required ports are out of range
- Probe localhost ports and increment offsets when base ports are taken
- Resolve server/web offsets by mode while honoring explicit port/dev-url overrides
- Add tests for offset selection and per-mode fallback behavior
- Prefer `T3CODE_STATE_DIR` from env when `--state-dir` is unset or blank
- Throw on invalid `T3CODE_PORT` overrides and always recompute `VITE_WS_URL`
- Add tests for env/state-dir precedence, blank overrides, and invalid ports
- default root dev commands to `T3CODE_STATE_DIR=~/.t3/dev`
- add `--` flag forwarding in `scripts/dev-runner.mjs` for server env flags
- resolve desktop state dir from `T3CODE_STATE_DIR` with new tests for desktop and dev runner