Skip to content

Conversation

@ibetitsmike
Copy link
Contributor

When creating a new workspace fails because a workspace with the same name already exists, automatically retry with a random 4-char suffix (e.g., my-workspace-ab12). Retries up to 3 times before failing.

This applies to both:

  • Auto-generated workspace names (from first message)
  • User-specified workspace names (via WORKSPACE_CREATE IPC)

Generated with mux

When creating a new workspace fails because a workspace with the same
name already exists, automatically retry with a random 4-char suffix
(e.g., 'my-workspace-ab12'). Retries up to 3 times before failing.

This applies to both:
- Auto-generated workspace names (from first message)
- User-specified workspace names (via WORKSPACE_CREATE IPC)

_Generated with mux_
@ibetitsmike ibetitsmike force-pushed the workspace-name-collision-retry branch from e61216a to 455dd57 Compare November 28, 2025 10:02
@ibetitsmike ibetitsmike added this pull request to the merge queue Nov 28, 2025
Merged via the queue into main with commit 5fa9658 Nov 28, 2025
13 checks passed
@ibetitsmike ibetitsmike deleted the workspace-name-collision-retry branch November 28, 2025 14:15
github-merge-queue bot pushed a commit that referenced this pull request Dec 3, 2025
## Summary

Reintroduces the ORPC refactoring originally merged in #763 and reverted
in #777.

This replaces the custom IPC layer with [oRPC](https://orpc.unnoq.com/)
for type-safe RPC between browser/renderer and backend processes.

## Why it was reverted (#777)

The original migration caused regressions:
- Streaming content delay from ORPC schema validation
- Field stripping issues in sendMessage output  
- Auto-compaction trigger deletion

## What's different this time

- Rebased onto latest main which includes fixes developed post-revert
- Conflict resolution preserves upstream features added after revert:
  - Workspace name collision retry with hash suffix (#779)
  - Mux Gateway coupon code handling with default models
  - AWS Bedrock credential nested structure

## Key Changes

### Architecture
- **New ORPC router** (`src/node/orpc/router.ts`) - Central router with
Zod schemas
- **Schema definitions** (`src/common/orpc/schemas.ts`) - Shared
validation
- **ServiceContainer** (`src/node/services/serviceContainer.ts`) - DI
container
- **React integration** (`src/browser/orpc/react.tsx`) - `ORPCProvider`
and `useORPC()`

### Transport
- **Desktop (Electron)**: MessagePort-based RPC via
`@orpc/server/message-port`
- **Server mode**: HTTP + WebSocket via `@orpc/server/node` and
`@orpc/server/ws`
- Auth middleware with timing-safe token comparison

### Removed
- `src/browser/api.ts` (old HTTP/WS client)
- `src/node/services/ipcMain.ts` (old IPC handler registration)
- Old IPC method definitions in preload.ts

## Test plan

- [x] Run `make typecheck` - passes locally
- [x] Run `make test` - verify existing tests pass
- [x] Manual testing of desktop app (Electron)
- [x] Manual testing of server mode (browser)
- [x] Verify streaming chat works without delays
- [x] Verify auto-compaction triggers correctly

---
_Generated with [mux](https://github.com/coder/mux)_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant