Skip to content

fix(desktop): auto-bump dev port when 5173 is occupied#1698

Open
Myestery wants to merge 2681 commits into
different-ai:devfrom
Myestery:fix/desktop-dev-port-collision
Open

fix(desktop): auto-bump dev port when 5173 is occupied#1698
Myestery wants to merge 2681 commits into
different-ai:devfrom
Myestery:fix/desktop-dev-port-collision

Conversation

@Myestery
Copy link
Copy Markdown

@Myestery Myestery commented May 7, 2026

Closes #1697

Summary

  • Detect actual port occupancy via connect-probe on IPv4 + IPv6 localhost (reuses existing probeHost); the previous listen-only check missed Vite's [::1]-only binding.
  • If default port is busy, scan upward for the first free port (5173-5272), rebuild startUrl + viteProbeUrls, log the bump.
  • Honor explicit PORT= override by failing fast instead of silently re-assigning.
  • Drop the portIsOpenForVite "port-open == Vite-ready" fallback that caused Electron to load stranger processes serving on 5173.
  • Tighten fetchWithTimeout default 4000ms → 1500ms; the 4s timeout caused ~12s probe hangs against non-HTTP TCP listeners on the bumped path.

apps/app/vite.config.ts is unchanged — strictPort: true stays correct now that the launcher guarantees a free port.

Test plan

  • pnpm dev with 5173 free → Vite + Electron come up on 5173.
  • python3 -m http.server 5173 (or raw TCP listener) in another shell, then pnpm dev → log shows Port 5173 busy — using 5174 instead, Electron loads the openwork app at 5174 (not the stranger).
  • PORT=5173 pnpm dev with 5173 busy → fails fast with a clear error.
  • PORT=6001 pnpm dev with 6001 free → Vite + Electron come up on 6001.

benjaminshafii and others added 30 commits April 28, 2026 21:48
…rent-ai#1608)

- Expand publish-electron job in Release App workflow from macOS-only
  to a 4-target matrix: macOS arm64, macOS x64, Linux x64, Windows x64
- Each target builds sidecars for the correct architecture via TARGET env
- macOS targets get codesign + notarization; Linux/Windows publish unsigned
- Add VITE_OPENWORK_FORCE_MIGRATION_PROMPT dev flag so migration prompt
  can be tested in dev:tauri without a real migration release build
* fix(cloud): avoid blank screen during signin check

* fix(cloud): surface signin while boot overlay waits
* server: harden MCP config validation

* server: require strict remote MCP URL format
…1548)

* feat(settings): add user env vars UI + shell injection

Add a Settings → Environment pane for user-level environment variables
persisted to ~/.config/openwork/env.json (0o600), plus shell and
orchestrator injection so the values reach every child process OpenWork
spawns (OpenCode, OpenWork server, opencode-router).

Fixes the Linux GUI silent-auth-failure case where shell env isn't
inherited. Scope is the OSS / self-hosted path; Den's cloud
LLM Providers push continues to own the org-signed-in case.

Closes different-ai#1436.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(settings): whitelist 'environment' tab in parseSettingsPath

parseSettingsPath had a hardcoded switch listing every known tab. The
new 'environment' case wasn't in it, so /settings/environment fell
through to default: and redirected to /settings/general.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(env-vars): reframe copy around service credentials, not plumbing

The initial copy described env vars in defensive terms ("so the app can
read them without a terminal launch"), which hides the actual value: a
single place to drop credentials for every external service skills and
MCPs call into (ElevenLabs, Gemini image APIs, GitHub, LangSmith, cloud
projects, corporate proxies, etc.).

- Reframe settings.tab_description_environment to lead with user intent.
- Reframe the panel description to mention MCPs + plugin subprocesses
  explicitly, since those are the biggest consumers.
- Empty-state example keys broadened from just ANTHROPIC_API_KEY to a
  cross-section that reflects actual workspace usage.
- PRD "Why" section rewritten on the same axis, with explicit
  non-overlap callouts vs. OpenCode provider auth and Den's cloud
  LLM Providers push.

Copy updates applied to en, zh, ja; other locales fall back to en.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* refactor(env-vars): tighten auth, harden UI, expand tests

Server:
- Routes switch from `host` to `host-token` auth. Owner-scoped remote
  bearer tokens are now also rejected — env vars are strictly
  desktop-host-only.
- env-file loader + reserved-keys policy tightened in line with Rust
  / Electron / orchestrator loaders.

Tests:
- env-routes.e2e.test.ts gains owner-bearer rejection + CORS PUT
  preflight tests.
- 23 pass total across env-file + env-routes; full server suite 106/0.

UI:
- environment-view.tsx: ConfirmModal instead of window.confirm,
  request-race guard on refresh, Escape-to-close editor, aria labels,
  cleaner empty / loading state for remote workspaces.

Copy:
- en / zh / ja strings pruned to reflect service-credentials framing;
  PRD updated to match.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(env-vars): polish apply flow and evidence

* Harden env var prompt context

* chore(env-vars): add locale fallbacks

* fix env store corruption handling

* block env apply while tasks run

* fix sidecar signing path list

* fix env apply state and store races

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: src-opn <src-opn@users.noreply.github.com>
* polish permission approval UX

* Clarify permission approval risks

* chore(permission): add locale fallbacks

* wire permission prompts through session sync

* tighten permission approval flow
…rent-ai#1612)

* feat: add welcome/onboarding screen for first-time users

When a user opens OpenWork with zero workspaces and has not completed
onboarding, the app redirects to a full-screen /welcome page showing
what OpenWork can do (spreadsheets, browser automation, files, etc.)
and a single 'Get started' CTA that opens the workspace creation modal.

Also adds a folder explanation to the local workspace panel so users
understand that the folder they pick becomes their workspace and that
OpenWork reads/writes files in it.

Changes:
- New /welcome route with WelcomePage component
- WelcomeRoute wires CreateWorkspaceModal for first-run flow
- hasCompletedOnboarding flag in LocalPreferences (persisted)
- Session route redirects to /welcome when 0 workspaces + not onboarded
- Local workspace panel shows folder purpose explanation with checkmarks
- 21 new i18n keys for welcome screen + folder explanation
- 7 eval flows (Flows 20-26) covering the onboarding experience

* fix: wrap bare $getRoot() in editor.read() to prevent SyncPlugin crash

serializePromptFromRoot() calls $getRoot() which requires an active
Lexical editor state. The useEffect on line 409 was calling it outside
of editor.update()/editor.read(), causing an uncaught error that took
down the entire React tree on 0.12.7:

  Unable to find an active editor state. State helpers or node methods
  can only be used synchronously during the callback of editor.update(),
  editor.read(), or editorState.read().

Fix: wrap the bare call in editor.getEditorState().read().

* test: add Chrome MCP screenshots for onboarding eval flows

Verified via Electron dev app + Chrome DevTools MCP:
- Flow 20: Welcome screen renders with 6 capability cards
- Flow 21: Get started opens CreateWorkspaceModal with 3 options
- Flow 23: Folder explanation with checkmarks visible in local panel
- Flow 25: Session page renders normally when workspaces exist
  (no redirect to /welcome despite hasCompletedOnboarding=false)
release-bot and others added 27 commits May 13, 2026 04:09
…ai#1784)

- Remove Skill Hubs and Shared Workspace sidebar nav items (commented out for easy re-enablement)
- Rename "Shared Workspaces" to "Background Tasks (coming soon)" across all marketing copy
- Update checkout, dashboard, organization, and background-agents screens
- Replace "shared workspace" with "cloud worker" in den-api 402 error messages
- Reframe billing copy around team features instead of shared workspaces
* chore: remove ARCHITECTURE.md and INFRASTRUCTURE.md, clean up AGENTS.md references

* chore: remove DESIGN-LANGUAGE, DESIGN-SYSTEM, PRINCIPLES, PRODUCT, VISION, RELEASE, TRIAGE docs
* feat: Daytona/devcontainer setup for full-stack testing (Den + App, no Electron needed)

* feat: Electron in Daytona via Xvfb + noVNC — real desktop app in the browser, CDP automation on :9825

* fix: Daytona Dockerfile with bun/dbus/vite-host fixes, daytona-dev skill for team

* fix: restore AGENTS.md from dev (remove stale additions)
…different-ai#1787)

* feat: CDP browser tools — direct OpenCode tools, no MCP, multi-target

- .opencode/tools/browser.ts: 7 tools (list, navigate, snapshot, click, fill, eval, screenshot)
- .opencode/tools/lib/cdp.ts: raw WebSocket CDP client, no Puppeteer
- .opencode/tools/lib/snapshot.ts: accessibility tree snapshots with UIDs

Every tool takes browser_url + optional target_id. No singleton browser.
No npx. No MCP subprocess. Works against any Chrome/Electron with CDP.

Tested against Daytona sandbox: target listing, eval, accessibility tree (202 nodes),
screenshot, button discovery all verified.

* fix: rewrite CDP WebSocket URLs when accessing via proxy (Daytona)

* feat: Daytona eval flows, run-evals skill, updated evals README with browser tools

- evals/daytona-flows.md: 3 flows (workspace creation, send message, screenshot)
  with exact code for React fiber dispatch, Lexical input, button clicking
- .opencode/skills/run-evals/SKILL.md: skill that guides agents through
  sandbox creation, service startup, and eval execution
- evals/README.md: updated with Daytona as recommended option, browser_*
  tool reference, conventions for Lexical/React state injection
* feat(inference): add OpenWork inference proxy

* chore(den-api): update generated app version

* chore(desktop): add bootstrap config diagnostics

* chore(inference): log OpenRouter webhook payloads

* chore(inference): log webhook auth diagnostics

* chore(inference): add local dev env defaults

* feat(inference): settle usage from internal pricing

* chore(inference): remove temporary webhook debug logs

* feat(inference): expose OpenWork model catalog

* feat(inference): generate public model catalog

* docs(inference): note upstream model source

* feat(inference): refine usage accounting

* feat(inference): split model catalog hosting

* chore(inference): log proxy issues as errors

* feat(server): configure managed OpenCode models URL

* feat(billing): add Stripe inference subscriptions

* fix(billing): hide owner notice from owners

* fix(billing): only show polar section when feature gate enabled

* chore(billing): remove annual and quantity copy from stripe card

* chore(billing): simplify stripe pricing description

* chore(inference): simplify inference screen copy

* feat(billing): redesign stripe checking page

* chore(billing): remove subscription quantity copy

* feat(inference): show usage limits and update enabled title

* chore(inference): add description above usage limits

* chore(inference): merge usage limits description into card

* feat(inference): redirect disable action to billing

* feat(llm-providers): split openwork keys into table section

* chore(sidebar): rename inference to openwork models and reorder

* chore(inference): use openwork models as page title

* chore(inference): punch up tagline

* chore: sync inference catalog and misc app updates

---------

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
* fix(billing): allow promo codes for Stripe checkout

* chore(billing): rely on configured Stripe price currency

---------

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
Co-authored-by: src-opn <src-opn@users.noreply.github.com>
…1792)

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
Co-authored-by: src-opn <src-opn@users.noreply.github.com>
Co-authored-by: src-opn <src-opn@users.noreply.github.com>
Co-authored-by: src-opn <src-opn@users.noreply.github.com>
Co-authored-by: src-opn <src-opn@users.noreply.github.com>
Co-authored-by: src-opn <src-opn@users.noreply.github.com>
…-ai#1803)

Co-authored-by: src-opn <src-opn@users.noreply.github.com>
…-collision

# Conflicts:
#	apps/desktop/scripts/electron-dev.mjs
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.

desktop: dev launcher loads stranger process when port 5173 is occupied