Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
feat!: move default ports to the serial 5678 block
trohitgd8d905730549
diff --git a/.env b/.envindex 618328f2..caaab82c 100644--- a/.env+++ b/.env@@ -1,13 +1,13 @@# Service Ports (used by start.js, vite, and docker-compose)-VITE_CLIENT_PORT=3000-PYTHON_BACKEND_PORT=3010-NODEJS_EXECUTOR_PORT=3020-WHATSAPP_RPC_PORT=9400+VITE_CLIENT_PORT=5679+PYTHON_BACKEND_PORT=5678+NODEJS_EXECUTOR_PORT=5680+WHATSAPP_RPC_PORT=5681REDIS_PORT=6379# Server ConfigurationHOST=127.0.0.1-PORT=3010+PORT=5678DEBUG=falseWORKERS=1@@ -27,7 +27,7 @@ JWT_COOKIE_SECURE=falseJWT_COOKIE_SAMESITE=lax# CORS Configuration - Allow all common dev ports-CORS_ORIGINS=["http://localhost:3000","http://localhost:3001","http://localhost:3002","http://localhost:3003","http://localhost:3004","http://localhost:3005","http://localhost:3006","http://127.0.0.1:3000","http://127.0.0.1:3001","http://127.0.0.1:3002","http://127.0.0.1:3003","http://127.0.0.1:3004","http://127.0.0.1:3005","http://127.0.0.1:3006","http://localhost:5173"]+CORS_ORIGINS=["http://localhost:5678","http://localhost:5679","http://127.0.0.1:5678","http://127.0.0.1:5679","http://localhost:5173"]# Database Configuration# SQLite DB filename. Resolved under DATA_DIR by@@ -51,7 +51,7 @@ CACHE_TTL=300# by pooch from https://temporal.download/cli/archive/latest on# ``company build`` (or first ``company start`` if build was skipped).TEMPORAL_ENABLED=true-TEMPORAL_SERVER_ADDRESS=localhost:7233+TEMPORAL_SERVER_ADDRESS=localhost:5682TEMPORAL_NAMESPACE=default# Durable Temporal wire identifier retained so upgrades can resume in-flight# workflows. New display/package identifiers use OpenCompany.@@ -60,12 +60,12 @@ TEMPORAL_PER_TYPE_DISPATCH=trueTEMPORAL_AGENT_WORKFLOW_ENABLED=true# gRPC frontend port the CLI dev server binds (``--port``). Default per# https://docs.temporal.io/references/configuration.-TEMPORAL_FRONTEND_GRPC_PORT=7233+TEMPORAL_FRONTEND_GRPC_PORT=5682# Web UI port (``--ui-port``). ``temporal server start-dev`` defaults# this to ``--port + 1000``; we override to 8080 to match the# historical OpenCompany port (kept for muscle memory + bookmarks).# Browse to http://<host>:<TEMPORAL_UI_PORT>/.-TEMPORAL_UI_PORT=8080+TEMPORAL_UI_PORT=5683# SQLite db file ``temporal server start-dev --db-filename`` opens.# Relative to DATA_DIR (= ~/.opencompany/) unless absolute. Flat under# DATA_DIR like ``credentials.db`` / ``workflow.db``. History isdiff --git a/.env.template b/.env.templateindex f3d5c90a..abda29cf 100644--- a/.env.template+++ b/.env.template@@ -1,13 +1,17 @@-# Service Ports (used by start.js, vite, and docker-compose)-VITE_CLIENT_PORT=3000-PYTHON_BACKEND_PORT=3010-NODEJS_EXECUTOR_PORT=3020-WHATSAPP_RPC_PORT=9400+# Service Ports — serial non-standard block starting at 5678 so+# OpenCompany never collides with common dev servers (3000/8080/etc.):+# 5678 backend app (API + WS + SPA), 5679 Vite dev client,+# 5680 Node.js executor, 5681 WhatsApp RPC,+# 5682 Temporal gRPC, 5683 Temporal Web UI.+VITE_CLIENT_PORT=5679+PYTHON_BACKEND_PORT=5678+NODEJS_EXECUTOR_PORT=5680+WHATSAPP_RPC_PORT=5681REDIS_PORT=6379# Server ConfigurationHOST=127.0.0.1-PORT=3010+PORT=5678DEBUG=falseWORKERS=1@@ -26,8 +30,9 @@ JWT_COOKIE_NAME=opencompany_tokenJWT_COOKIE_SECURE=falseJWT_COOKIE_SAMESITE=lax-# CORS Configuration - Allow all common dev ports-CORS_ORIGINS=["http://localhost:3000","http://localhost:3001","http://localhost:3002","http://localhost:3003","http://localhost:3004","http://localhost:3005","http://localhost:3006","http://127.0.0.1:3000","http://127.0.0.1:3001","http://127.0.0.1:3002","http://127.0.0.1:3003","http://127.0.0.1:3004","http://127.0.0.1:3005","http://127.0.0.1:3006","http://localhost:5173"]+# CORS Configuration - the app port, the Vite dev client, and Vite's+# bare default (5173) for ad-hoc runs+CORS_ORIGINS=["http://localhost:5678","http://localhost:5679","http://127.0.0.1:5678","http://127.0.0.1:5679","http://localhost:5173"]# Database Configuration# SQLite DB filename. Resolved under DATA_DIR by@@ -51,7 +56,7 @@ CACHE_TTL=300# by pooch from https://temporal.download/cli/archive/latest on# ``company build`` (or first ``company start`` if build was skipped).TEMPORAL_ENABLED=true-TEMPORAL_SERVER_ADDRESS=localhost:7233+TEMPORAL_SERVER_ADDRESS=localhost:5682TEMPORAL_NAMESPACE=default# Durable Temporal wire identifier retained so upgrades can resume in-flight# workflows. New display/package identifiers use OpenCompany.@@ -78,14 +83,13 @@ DEPLOYMENT_MODE=local# Examples:# 4-core laptop: TEMPORAL_AI_HEAVY_CONCURRENCY=2 TEMPORAL_BROWSER_CONCURRENCY=2 TEMPORAL_CODE_EXEC_CONCURRENCY=4# 32-core cloud: TEMPORAL_AI_HEAVY_CONCURRENCY=16 TEMPORAL_BROWSER_CONCURRENCY=8 TEMPORAL_CODE_EXEC_CONCURRENCY=32-# gRPC frontend port the CLI dev server binds (``--port``). Default per-# https://docs.temporal.io/references/configuration.-TEMPORAL_FRONTEND_GRPC_PORT=7233+# gRPC frontend port the dev server binds (``--port``) — part of the+# 5678-based serial port block (Temporal's own default is 7233).+TEMPORAL_FRONTEND_GRPC_PORT=5682# Web UI port (``--ui-port``). ``temporal server start-dev`` defaults-# this to ``--port + 1000``; we override to 8080 to match the-# historical OpenCompany port (kept for muscle memory + bookmarks).+# this to ``--port + 1000``; pinned into the serial port block instead.# Browse to http://<host>:<TEMPORAL_UI_PORT>/.-TEMPORAL_UI_PORT=8080+TEMPORAL_UI_PORT=5683# SQLite db file ``temporal server start-dev --db-filename`` opens.# Relative to DATA_DIR (= ~/.opencompany/) unless absolute. Flat under# DATA_DIR like ``credentials.db`` / ``workflow.db``. History isdiff --git a/CLAUDE.md b/CLAUDE.mdindex de7d3215..39bb593f 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -216,10 +216,10 @@ Persistent Node.js server for JavaScript/TypeScript code execution, replacing su**Architecture:**```┌─────────────────────────────────────────────────────────────┐-│ Python Backend (port 3010) │+│ Python Backend (port 5678) ││ ┌────────────────┐ HTTP/JSON ┌──────────────────┐ ││ │ NodeJSClient │◄──────────────────►│ Node.js Server │ │-│ │ (aiohttp) │ localhost:3020 │ (Express + tsx) │ │+│ │ (aiohttp) │ localhost:5680 │ (Express + tsx) │ ││ └────────────────┘ └──────────────────┘ ││ ▲ ││ │ │@@ -257,9 +257,9 @@ server/nodes/code/ # Executor plugins (javascript_executor, types**Environment Variables:**| Variable | Default | Description ||----------|---------|-------------|-| `NODEJS_EXECUTOR_URL` | `http://localhost:3020` | Server URL for Python client |+| `NODEJS_EXECUTOR_URL` | `http://localhost:5680` | Server URL for Python client || `NODEJS_EXECUTOR_TIMEOUT` | `30` | Request timeout in seconds |-| `NODEJS_EXECUTOR_PORT` | `3020` | Server port |+| `NODEJS_EXECUTOR_PORT` | `5680` | Server port || `NODEJS_EXECUTOR_HOST` | `localhost` | Server host || `NODEJS_EXECUTOR_BODY_LIMIT` | `10mb` | Max request body size |@@ -622,8 +622,8 @@ Node groups (palette categories): agent, model, skill, tool, trigger, workflow,## Backend Services### Python Backend (FastAPI)-- **Port**: 3010-- **Base URL**: http://localhost:3010+- **Port**: 5678+- **Base URL**: http://localhost:5678- **Main File**: `server/main.py`### API Endpoints@@ -686,7 +686,7 @@ Node groups (palette categories): agent, model, skill, tool, trigger, workflow,### Temporal Distributed Execution-Workflows execute via Temporal for durability and horizontal scaling, gated by `TEMPORAL_ENABLED`. Three dispatch paths exist — legacy single `execute_node_activity` (fallback), per-type `node.{type}.v{version}` activities (F4.A, `TEMPORAL_PER_TYPE_DISPATCH=true`), and Agent-as-child-workflow (F4.B, `TEMPORAL_AGENT_WORKFLOW_ENABLED=true`) — with `rlm_agent`/`claude_code_agent` always bypassing AgentWorkflow. **Per-queue activity routing is production-default (Wave 16)**: a `TemporalWorkerPool` runs one activity-only worker per plugin-declared `cls.task_queue` (ai-heavy / browser / code-exec / rest-api / messaging / ...) with per-queue concurrency + rate limits + resource-based tuning for ai-heavy/browser; rollback via `TEMPORAL_WORKER_POOL_ENABLED=false`. Resilience knobs (Waves 17-18): `DEPLOYMENT_MODE` (local halves concurrency; sizes the sticky cache), one-shot retry on `agent.execute_llm_step.v1` (LLM calls are not idempotent), observability interceptors (`activity_retry` WARN on re-dispatch), 30s periodic heartbeat during long activity bodies, cron `catchup_window=24h`, poller autoscaling. Execution routing falls back Temporal → sequential; the Temporal dev server + embedded worker are managed in-process under `server/services/temporal/` (pooch-downloaded CLI, single `temporal server start-dev` process, gRPC 7233 + Web UI 8080, SQLite at `~/.opencompany/temporal.db`). Full architecture, dispatch matrix, per-node + agent-loop lifecycle, all 16 F4.B `agent.*.v1` activities, heartbeat semantics, delegation input contract, resumption toggle (`TEMPORAL_TERMINATE_RUNNING_ON_STARTUP`), the worker tuning recipe, and all `.env` tunables live in [docs-internal/TEMPORAL_ARCHITECTURE.md](./docs-internal/TEMPORAL_ARCHITECTURE.md).+Workflows execute via Temporal for durability and horizontal scaling, gated by `TEMPORAL_ENABLED`. Three dispatch paths exist — legacy single `execute_node_activity` (fallback), per-type `node.{type}.v{version}` activities (F4.A, `TEMPORAL_PER_TYPE_DISPATCH=true`), and Agent-as-child-workflow (F4.B, `TEMPORAL_AGENT_WORKFLOW_ENABLED=true`) — with `rlm_agent`/`claude_code_agent` always bypassing AgentWorkflow. **Per-queue activity routing is production-default (Wave 16)**: a `TemporalWorkerPool` runs one activity-only worker per plugin-declared `cls.task_queue` (ai-heavy / browser / code-exec / rest-api / messaging / ...) with per-queue concurrency + rate limits + resource-based tuning for ai-heavy/browser; rollback via `TEMPORAL_WORKER_POOL_ENABLED=false`. Resilience knobs (Waves 17-18): `DEPLOYMENT_MODE` (local halves concurrency; sizes the sticky cache), one-shot retry on `agent.execute_llm_step.v1` (LLM calls are not idempotent), observability interceptors (`activity_retry` WARN on re-dispatch), 30s periodic heartbeat during long activity bodies, cron `catchup_window=24h`, poller autoscaling. Execution routing falls back Temporal → sequential; the Temporal dev server + embedded worker are managed in-process under `server/services/temporal/` (pooch-downloaded CLI, single `temporal server start-dev` process, gRPC 5682 + Web UI 5683, SQLite at `~/.opencompany/temporal.db`). Full architecture, dispatch matrix, per-node + agent-loop lifecycle, all 16 F4.B `agent.*.v1` activities, heartbeat semantics, delegation input contract, resumption toggle (`TEMPORAL_TERMINATE_RUNNING_ON_STARTUP`), the worker tuning recipe, and all `.env` tunables live in [docs-internal/TEMPORAL_ARCHITECTURE.md](./docs-internal/TEMPORAL_ARCHITECTURE.md).**Temporal tracing ownership is strict.** Register the SDK `TracingInterceptor` exactly once on the shared `Client.connect(...)`; the Python SDK automatically prepends compatible client interceptors to every worker. Never repeat `TracingInterceptor` in `Worker(..., interceptors=...)`. Worker lists contain the distinct `ObservabilityWorkerInterceptor` and plugin-specific worker interceptors only. Exact paired `StartActivity` / `RunActivity` / `CompleteWorkflow` console spans with identical Temporal identities indicate duplicate instrumentation, not duplicate execution; use Temporal Event History and the `node.<type>.execute` application span to verify actual attempts. See the tracing and debugging sections in [TEMPORAL_ARCHITECTURE.md](./docs-internal/TEMPORAL_ARCHITECTURE.md) and [errors.md](./docs-internal/errors.md).@@ -734,7 +734,7 @@ See **[Scripts Reference](./docs-internal/SCRIPTS.md)** for full documentation.✅ **Process Management**: Robust stop scripts with duplicate process detection✅ **WhatsApp Integration**: Square node design with QR code viewer, group/sender name persistence, newsletter channel support (send, query, follow/unfollow, create, mute, mark viewed, react, live updates), media download, profile pics, and proper error handling✅ **Backend Stability**: Fixed dependency injection and error handling preventing crashes-✅ **Development Server**: `company dev` = Vite HMR at **http://localhost:3000** + backend at **http://localhost:3010**; `company start` (production) = single port **http://localhost:3010** (API + WS + SPA)+✅ **Development Server**: `company dev` = Vite HMR at **http://localhost:5679** + backend at **http://localhost:5678**; `company start` (production) = single port **http://localhost:5678** (API + WS + SPA)✅ **WebSocket Integration**: Persistent WebSocket connections for remote Android devices with background tasks and message queue✅ **Real-time Status WebSocket**: Frontend-backend WebSocket at `/ws/status` for live Android status, node status, and variable updates✅ **Event-Driven Trigger Nodes**: WhatsApp Receive and Webhook Trigger with asyncio.Future-based event waiting, filter builders, and cancel support@@ -1121,7 +1121,7 @@ Full reference — agent loop, skill injection, tool building, input/auto-prompt## Testing & Validation```bash# Development server test-curl -I http://localhost:3010+curl -I http://localhost:5678# TypeScript validationnpx tsc --noEmit@@ -1780,11 +1780,11 @@ export interface AndroidStatus {## WhatsApp Integration### Overview-WhatsApp nodes use square design with integrated QR code viewing and proper error handling. The integration proxies all requests through the Python backend to the WhatsApp RPC service (default port 9400, configurable via `WHATSAPP_RPC_PORT` env var or `--port` CLI flag). Supports individual chats, groups, and newsletter channels (sending, querying, follow/unfollow, create, mute, mark viewed, react, live updates, media download, profile pics). All 14 WhatsApp events handled.+WhatsApp nodes use square design with integrated QR code viewing and proper error handling. The integration proxies all requests through the Python backend to the WhatsApp RPC service (default port 5681, configurable via `WHATSAPP_RPC_PORT` env var or `--port` CLI flag). Supports individual chats, groups, and newsletter channels (sending, querying, follow/unfollow, create, mute, mark viewed, react, live updates, media download, profile pics). All 14 WhatsApp events handled.### Architecture```-Frontend (WhatsAppNode.tsx) → Python Backend (/api/whatsapp/*) → WhatsApp RPC Service (localhost:${WHATSAPP_RPC_PORT:-9400})+Frontend (WhatsAppNode.tsx) → Python Backend (/api/whatsapp/*) → WhatsApp RPC Service (localhost:${WHATSAPP_RPC_PORT:-5681})```### Key Features@@ -2612,7 +2612,7 @@ This function:- **WhatsApp Integration**: Square node design with QR code viewer, proper error handling, no crashes- Critical fix: Added "routers.whatsapp" to dependency injection wiring- All endpoints use safe JSON parsing with comprehensive error handling- - Backend proxies all requests to WhatsApp RPC service (default port 9400, configurable)+ - Backend proxies all requests to WhatsApp RPC service (default port 5681, configurable)- Returns proper HTTP status codes (503, 504, 410) instead of mock data- Python server never crashes when WhatsApp service is unavailable- WebSocket handlers for status, QR code, send message, and start connection@@ -2663,7 +2663,7 @@ This function:- Published to PyPI as `whatsapp-rpc` (async Python client)- Cross-platform binaries built via GitHub Actions (linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, windows/amd64)- Binary downloaded from GitHub releases during npm postinstall- - Configurable port via `--port` CLI flag, `PORT` or `WHATSAPP_RPC_PORT` env vars (default: 9400)+ - Configurable port via `--port` CLI flag, `PORT` or `WHATSAPP_RPC_PORT` env vars (OpenCompany passes 5681; the package's own default is 9400)- QR codes generated as base64 PNG in memory (no file I/O, no `data/qr` directory)- Source: https://github.com/trohitg/whatsapp-rpc- **Node Data Architecture**: `node.data` only stores `label` (display name). All parameters are stored in the database via `save_node_parameters` WebSocket handler. This prevents parameter bloat in workflow JSON exports and keeps React Flow state lightweight. `useDragAndDrop.ts` saves default parameters to DB on drop, not to `node.data`.@@ -2671,7 +2671,7 @@ This function:- **Skill System Architecture**: Skills organized in `server/skills/<folder>/` subfolders. Each folder appears in Master Skill dropdown. DB/Master Skill customization is authoritative. Standard skills use progressive disclosure without modifying the agent system prompt: the dynamically connected `Skill` tool carries the bounded name/description catalogue, loads instructions, then separately reads/searches declared resources. Personality skills remain eager. Duplicate connected names block with `DUPLICATE_CONNECTED_SKILL_NAME`. Runtime state and sanitized `agent.skill.*` observability live in [`skill_runtime.py`](./server/services/skill_runtime.py); tool results persist in the current conversation while canvas badges clear at turn end. Icon resolution mirrors `BaseNode._metadata_dict`: per-plugin `<plugin>/icon.svg` (served as `/api/schemas/nodes/<type>/icon`) → `visuals.json` (emoji / `lobehub:<brand>`); color: per-plugin `<plugin>/meta.json` → `visuals.json`. Lives in [`skill_loader.py::_parse_skill_metadata`](./server/services/skill_loader.py). Native DOM keydown handler prevents React Flow from intercepting Ctrl shortcuts in skill editor. **Mutation broadcasts use the CloudEvents-typed `skill_lifecycle` wire key** with stages `created` / `updated` / `deleted` / `content_saved` — see "Plugin-folder location for plugin-specific CloudEvents factories" below.- **Example Workflows**: Auto-load example workflow seeds from `<repo>/.opencompany/workflows/` on first use (git-tracked; the only non-ignored content under `<repo>/.opencompany/`). Path resolved by `core.paths.example_workflows_dir()` — fixed, NOT under `DATA_DIR`, preserved by `company clean` via `_OPENCOMPANY_KEEP`. Uses `UserSettings.examples_loaded` flag; supports anonymous users (`user_id="default"`); embedded `nodeParameters` saved to DB on import.- **Onboarding Service**: 5-step welcome wizard (Welcome, Concepts, API Keys, Canvas Tour, Get Started) using shadcn primitives + lucide icons. Database-backed via `UserSettings.onboarding_completed` + `onboarding_step`. Existing users auto-skip (migration marks `examples_loaded=1` as completed). Replayable from Settings "Help" section. No new WebSocket handlers needed. See [Onboarding Service](./docs-internal/onboarding.md) for details.-- **Node.js Code Executor**: Persistent Node.js server (Express + tsx) at port 3020 for JavaScript/TypeScript execution, replacing subprocess spawning per execution. The code executor plugins under `server/nodes/code/` call `NodeJSClient` which makes HTTP requests to the Node.js server. All config via environment variables (`NODEJS_EXECUTOR_URL`, `NODEJS_EXECUTOR_PORT`, etc.).+- **Node.js Code Executor**: Persistent Node.js server (Express + tsx) at port 5680 for JavaScript/TypeScript execution, replacing subprocess spawning per execution. The code executor plugins under `server/nodes/code/` call `NodeJSClient` which makes HTTP requests to the Node.js server. All config via environment variables (`NODEJS_EXECUTOR_URL`, `NODEJS_EXECUTOR_PORT`, etc.).- **writeTodos Tool Node**: Dedicated AI tool for task planning connecting to any agent's `input-tools` handle. `TodoService` singleton (`server/services/todo_service.py`) stores JSON-based per-session todo state keyed by workflow_id. Handler broadcasts `phase: "todo_update"` via WebSocket on each update for real-time UI. (The former checklist rendering — `formatTodoOutput()` — lived only in the legacy `ui/OutputDisplayPanel.tsx`, which was deleted as dead code; the active `components/output/OutputPanel.tsx` shows todo results as regular JSON.) Schema uses `TodoItem`/`TodoStatus` Pydantic enum. Skill at `server/skills/assistant/write-todos-skill/SKILL.md` teaches the plan-work-update loop.- **Temporal Activity Heartbeats**: Activities send `activity.heartbeat()` on every non-matching WebSocket broadcast inside the read loop in `services/temporal/activities.py`. This keeps long-running browser and claude_code_agent operations alive past the 2-minute `heartbeat_timeout`. Start/end heartbeats alone were causing `TIMEOUT_TYPE_HEARTBEAT` failures on ops taking 5-10 minutes. Connection config: `heartbeat=30`, `receive_timeout=540` (fits within 10-min `start_to_close_timeout`).- **WebSocket `_safe_send` Guard**: `server/routers/websocket.py` checks `websocket.client_state.name != "CONNECTED"` before sending and logs at `debug` level (not `error`) on failure. Prevents "ASGI message after websocket.close" errors when broadcasts race with disconnects.@@ -2687,7 +2687,7 @@ This function:- **Process manager port admission + middle panel**: server commands declare listener `ports` (with compatibility inference for `--port`, `-p`, `PORT`, and `*_PORT`). `ProcessService.start()` serializes admission, checks managed reservations plus OS TCP listeners, and returns structured `PORT_IN_USE` without killing the owner or allowing framework auto-port fallback. Explicit ports/environment survive restart. The `isProcessManagerPanel` UI hint gives only `processManager` a full-height workflow-scoped process table with PID/ports/timestamps/elapsed/output and stop/restart controls. See [docs-internal/process_manager.md](./docs-internal/process_manager.md).- **Telegram message auto-split**: Telegram Bot API caps `sendMessage.text` at 4096 chars (per https://core.telegram.org/bots/api). `TelegramService.send_message` splits longer text at paragraph → line → sentence → space → hard-cut boundaries via `_split_text` helper, sends each chunk threaded under the previous (`reply_to_message_id` cascade), returns first message's metadata + `parts` + `message_ids[]`. Captions on `send_photo` / `send_document` still take the legacy path and will fail on >1024 chars — separate fix once needed (constants `_TG_TEXT_LIMIT=3500`, `_TG_CAPTION_LIMIT=900` in `_service.py` already account for ~20% HTML expansion from markdown→HTML conversion in `_resolve_body`).- **Google OAuth scope expansion**: Google's authorisation server legitimately returns a wider scope set than requested when the OAuth Client's "Data Access" page lists extra scopes (commonly `cloud-platform`) or when `include_granted_scopes` replays a previously-granted scope. `oauthlib` does strict set-equality and aborts with `Warning: Scope has changed`. As of 2026 (`google-auth-oauthlib` 1.2.4, `oauthlib` upstream issue #562 still open), no constructor flag, context manager, or `expected_scopes` argument exists — the documented relief is the env var. `services/google_oauth.py` sets `OAUTHLIB_RELAX_TOKEN_SCOPE=1` via `os.environ.setdefault` BEFORE the `google_auth_oauthlib.flow` import (oauthlib reads it once at parameters-module import; request-time setting races under uvicorn workers), paired with `warnings.filterwarnings(message=r"Scope has changed.*")` to keep the operator log clean. Long-term root cause: audit the Cloud Console Data Access page and remove `cloud-platform` if no handler uses it.-- **Code-executor error mapping** (`pythonExecutor` / `javascriptExecutor` / `typescriptExecutor`): wrap user-code execution and sidecar calls in `try/except`. Python: detect `ImportError("__import__ not found")` (the LLM tried `import X` against the sandboxed builtins) and surface the pre-injected names list (`math, json, datetime, timedelta, re, random, Counter, defaultdict`) plus the suggestion to use `process_manager` for unsupported modules; other exceptions get formatted as `<ErrorName> at line N: <message>` (line N walked from `<string>` frame in the traceback) plus any captured stdout. JS/TS: detect `aiohttp.ClientConnectorError` and surface "JavaScript executor not running on localhost:3020. Start the dev runner or fall back to python_executor." All raise `NodeUserError` so the framework logs one WARN line — no aiohttp/CreateProcessW noise in the operator log.+- **Code-executor error mapping** (`pythonExecutor` / `javascriptExecutor` / `typescriptExecutor`): wrap user-code execution and sidecar calls in `try/except`. Python: detect `ImportError("__import__ not found")` (the LLM tried `import X` against the sandboxed builtins) and surface the pre-injected names list (`math, json, datetime, timedelta, re, random, Counter, defaultdict`) plus the suggestion to use `process_manager` for unsupported modules; other exceptions get formatted as `<ErrorName> at line N: <message>` (line N walked from `<string>` frame in the traceback) plus any captured stdout. JS/TS: detect `aiohttp.ClientConnectorError` and surface "JavaScript executor not running on localhost:5680. Start the dev runner or fall back to python_executor." All raise `NodeUserError` so the framework logs one WARN line — no aiohttp/CreateProcessW noise in the operator log.- **Workflow-scoped chat + console history**: chat messages persist with `chat_messages.session_id == <workflow_id>` (or `"default"` when no workflow is open); console logs persist with `console_logs.workflow_id`. Backend `database.get_console_logs(limit, workflow_id=None)` and `clear_console_logs(workflow_id=None)` filter by workflow when given. `handle_clear_console_logs` broadcasts `console_logs_cleared` carrying the `workflow_id` so the existing frontend filter in `WebSocketContext` keeps other workflows' panels intact. Frontend reads `currentWorkflow.id` via the documented Zustand escape hatch (`useAppStore.getState().currentWorkflow?.id`) at call time for `clearChatMessages` / `clearConsoleLogs` / `sendChatMessage` so the callbacks don't re-create on every workflow switch. A dedicated `useEffect([currentWorkflowId, isReady])` resets local `chatMessages` / `consoleLogs` and refetches both when the user opens / switches workflow. Incoming `console_log` broadcasts are filtered by `currentWorkflow.id` so a parallel run on another workflow never bleeds into the active panel. Legacy logs without `workflow_id` still surface (transition guard).- **Auto-derived `isConfigNode` uiHint**: `_derive_auto_ui_hints(group)` in `services/plugin/base.py` automatically sets `uiHints.isConfigNode: True` on any plugin whose `group` tuple contains `memory` or `tool` (centralized as `_CONFIG_NODE_GROUPS = frozenset({"memory", "tool"})`). Explicit `cls.ui_hints` always wins (merge order: auto first, then `dict.update`). Frontend `InputSection.tsx` and `OutputPanel.tsx` consume the flag via `definition?.uiHints?.isConfigNode === true` — the old `groups.includes('memory') || groups.includes('tool')` heuristic is gone. Pytest invariant `test_ui_hints_only_carry_known_flags` locks the flag name. Adding a new auxiliary node type costs zero per-plugin code; opting out costs one line (`ui_hints = {"isConfigNode": False}`).- **`isMasterSkillEditor` uiHint replaces `node.type === 'masterSkill'` checks**: 6 frontend callsites (`Dashboard.tsx:98` component dispatch, `useAutoSkillEdges.ts` constant + edge filter, `MiddleSection.tsx` × 3) now read `getCachedNodeSpec(type)?.uiHints?.isMasterSkillEditor === true` instead of comparing the type string. The `MasterSkillNode` plugin already declared the hint — no backend change. Renaming the plugin's `type` is now a single backend edit followed by a NodeSpec deploy; the frontend never needs to know the string.diff --git a/README.md b/README.mdindex 704434c9..786ff9a5 100644--- a/README.md+++ b/README.md@@ -22,7 +22,7 @@ npm install -g @zeenie-ai/opencompanycompany start```-Open http://localhost:3010 and click the key icon (**API Credentials**) in the toolbar to connect your first AI provider.+Open http://localhost:5678 and click the key icon (**API Credentials**) in the toolbar to connect your first AI provider.> **Upgrading from MachinaOS?** Existing `~/.machina` and checkout-local `.machina` state is detected when the new `.opencompany` location does not yet exist, so databases and deployment state are not stranded. The `machina` command remains available as a deprecated legacy alias; new scripts should use `company`.@@ -37,7 +37,7 @@ pnpm run buildpnpm run dev```-The `dev` task starts the Python backend, Vite client, WhatsApp service, and Temporal in parallel. See [SETUP.md](docs-internal/SETUP.md) and [SCRIPTS.md](docs-internal/SCRIPTS.md) for details, and [CONTRIBUTING.md](CONTRIBUTING.md) for the codebase map and contribution recipes.+The `dev` task starts the Python backend and the Vite client; optional daemons (WhatsApp, Temporal) are spawned by the backend on demand. See [SETUP.md](docs-internal/SETUP.md) and [SCRIPTS.md](docs-internal/SCRIPTS.md) for details, and [CONTRIBUTING.md](CONTRIBUTING.md) for the codebase map and contribution recipes.</details>diff --git a/cli/cli.py b/cli/cli.pyindex 84822ec2..8ac28f9b 100644--- a/cli/cli.py+++ b/cli/cli.py@@ -195,7 +195,7 @@ def _deploy_up(source: str = typer.Option("local", "--source", help="Install source: local (npm pack) or release (npm registry)."),version: str = typer.Option("latest", "--version", help="opencompany version when --source release."),machine_type: str = typer.Option("e2-standard-2", "--machine-type", help="VM size."),- port: int = typer.Option(8080, "--port", help="Public port the app binds + the firewall opens."),+ port: int = typer.Option(5678, "--port", help="Public port the app binds + the firewall opens."),allow_cidr: str = typer.Option("0.0.0.0/0", "--allow-cidr", help="Firewall source range (restrict to your IP/32)."),region: str | None = typer.Option(None, "--region", help="Cloud region (provider default if omitted)."),zone: str | None = typer.Option(None, "--zone", help="Cloud zone (provider default if omitted)."),diff --git a/cli/commands/deploy/_secrets.py b/cli/commands/deploy/_secrets.pyindex 44769e2e..ff44c007 100644--- a/cli/commands/deploy/_secrets.py+++ b/cli/commands/deploy/_secrets.py@@ -55,7 +55,7 @@ def build_app_env("TEMPORAL_ENABLED": "false","EVENT_FRAMEWORK_ENABLED": "false","REDIS_ENABLED": "false",- "NODEJS_EXECUTOR_PORT": "3020",+ "NODEJS_EXECUTOR_PORT": "5680","LOG_FORMAT": "text","JWT_SECRET_KEY": new_key(),"SECRET_KEY": new_key(),diff --git a/cli/commands/dev.py b/cli/commands/dev.pyindex 0f758925..5b6febc3 100644--- a/cli/commands/dev.py+++ b/cli/commands/dev.py@@ -99,15 +99,28 @@ def dev_command(console.print(f"Mode: {'Daemon (uvicorn)' if daemon else 'Development (uvicorn)'}")- console.print(f"Ports: {', '.join(str(p) for p in cfg.all_ports)}")- console.log("Freeing ports...")+ # ``all_ports`` is the reserved-port set being cleared of stale+ # orphans, NOT a list of services this command runs. Only the+ # client + backend are spawned here; the backend starts optional+ # daemons (WhatsApp, Temporal, ...) on demand.+ console.log(+ f"Freeing reserved ports ({', '.join(str(p) for p in cfg.all_ports)})..."+ )free_all_ports(cfg)console.log("Ports ready")use_vite = _has_vite(root)+ if use_vite:+ console.print(f"Client: Vite dev server at http://localhost:{cfg.client_port}")+ else:+ console.print(+ f"Client: built SPA served by the backend at http://localhost:{cfg.backend_port}"+ )+ console.print(f"Backend: http://localhost:{cfg.backend_port}")console.print(- f"Client: {'Vite dev server' if use_vite else 'served by backend (built SPA)'}"+ "Backend-spawned on demand: WhatsApp "+ f"(:{cfg.whatsapp_port}), Temporal (:{cfg.temporal_port} gRPC, :{cfg.temporal_ui_port} UI, when TEMPORAL_ENABLED)")if force:console.print("Vite: forced dependency re-bundle (--force)")diff --git a/cli/ports.py b/cli/ports.pyindex ea5da488..381d5d45 100644--- a/cli/ports.py+++ b/cli/ports.py@@ -143,7 +143,7 @@ def kill_port(port: int) -> KillResult:Post-kill recheck sleeps ``_POST_KILL_RECHECK_DELAY`` because Windowscan lag a few hundred ms releasing the listener socket after thebound process dies — without this, ``temporal server start-dev``'s- UI port (8080) frequently re-reports as in-use immediately after the+ UI port frequently re-reports as in-use immediately after thegRPC port kill, even though the kill on temporal.exe (one processbinds both ports — per docs.temporal.io/cli/server) succeeded."""diff --git a/client/src/assets/icons/index.test.ts b/client/src/assets/icons/index.test.tsindex 2f32299f..ce060a9d 100644--- a/client/src/assets/icons/index.test.ts+++ b/client/src/assets/icons/index.test.ts@@ -75,7 +75,7 @@ describe('resolveIcon', () => {it('prefixes /api/ icon paths with PYTHON_BASE_URL (RFC §6.5 — backend-served icons)', () => {// Per-plugin icon.svg endpoint emitted by BaseNode._metadata_dict// when the plugin folder has a co-located icon. Resolver prefixes- // PYTHON_BASE_URL so dev (Vite:3000 → backend:3010) and prod+ // PYTHON_BASE_URL so dev (Vite:5679 → backend:5678) and prod// (same-origin, empty prefix) both hit the right server.const resolved = resolveIcon('/api/schemas/nodes/aiAgent/icon');expect(resolved).not.toBeNull();diff --git a/client/src/assets/icons/index.ts b/client/src/assets/icons/index.tsindex c4825c01..2150dcc4 100644--- a/client/src/assets/icons/index.ts+++ b/client/src/assets/icons/index.ts@@ -104,8 +104,8 @@ export const resolveIcon = (icon: string | undefined | null): string | null => {return ICON_REGISTRY[icon.slice('asset:'.length)] ?? null;}if (icon.startsWith('/api/')) {- // Backend-served icon endpoint. In dev the FE runs on Vite:3000 and- // the backend on :3010, so a bare relative path would hit the Vite+ // Backend-served icon endpoint. In dev the FE runs on Vite:5679 and+ // the backend on :5678, so a bare relative path would hit the Vite// server. Prefix with PYTHON_BASE_URL (empty string in prod, full// localhost URL in dev) so the browser fetches the right origin.return `${API_CONFIG.PYTHON_BASE_URL}${icon}`;diff --git a/client/src/config/api.ts b/client/src/config/api.tsindex 3d0a6b27..6b5907d2 100644--- a/client/src/config/api.ts+++ b/client/src/config/api.ts@@ -19,8 +19,8 @@ function getApiConfig(): ApiConfig {!window.location.hostname.includes('127.0.0.1');return {- // Python FastAPI backend (port 3010 in dev, same origin in prod)- PYTHON_BASE_URL: viteEnv.VITE_PYTHON_SERVICE_URL || (isProduction ? '' : 'http://localhost:3010'),+ // Python FastAPI backend (port 5678 in dev, same origin in prod)+ PYTHON_BASE_URL: viteEnv.VITE_PYTHON_SERVICE_URL || (isProduction ? '' : 'http://localhost:5678'),};}diff --git a/client/vite.config.js b/client/vite.config.jsindex 795536fa..f380b47e 100644--- a/client/vite.config.js+++ b/client/vite.config.js@@ -89,7 +89,7 @@ export default defineConfig(({ mode }) => {},},server: {- port: parseInt(getEnv('VITE_CLIENT_PORT', '3000')),+ port: parseInt(getEnv('VITE_CLIENT_PORT', '5679')),strictPort: false,host: true},diff --git a/docs-internal/ROADMAP.md b/docs-internal/ROADMAP.mdindex cc4c0e86..04f9e931 100644--- a/docs-internal/ROADMAP.md+++ b/docs-internal/ROADMAP.md@@ -381,7 +381,7 @@ When `TEMPORAL_ENABLED=true`, each workflow node executes as an independent Temp#### Configuration```envTEMPORAL_ENABLED=true-TEMPORAL_SERVER_ADDRESS=localhost:7233+TEMPORAL_SERVER_ADDRESS=localhost:5682TEMPORAL_NAMESPACE=defaultTEMPORAL_TASK_QUEUE=machina-tasks```diff --git a/docs-internal/SCRIPTS.md b/docs-internal/SCRIPTS.mdindex 5b1dc7fb..205aa69d 100644--- a/docs-internal/SCRIPTS.md+++ b/docs-internal/SCRIPTS.md@@ -7,7 +7,7 @@ npm install -g @zeenie-ai/opencompanycompany start```-Open http://localhost:3010+Open http://localhost:5678## CLI Commands (`company`, Python Typer app under `cli/`)@@ -20,7 +20,7 @@ deprecation warning; kept for upgrade compatibility).| Command | Description ||---------|-------------|-| `company start` | Production mode, single port: uvicorn serves API + WS + built SPA on :3010. Optional daemons (Temporal dev server, WhatsApp) are backend-owned, started from the lifespan when enabled |+| `company start` | Production mode, single port: uvicorn serves API + WS + built SPA on :5678. Optional daemons (Temporal dev server, WhatsApp) are backend-owned, started from the lifespan when enabled || `company dev` | Start in dev mode (Vite HMR + uvicorn). `--force` re-bundles Vite deps (recovers "Outdated Optimize Dep"); `--daemon` binds backend to 0.0.0.0 || `company serve` | Single-port production runtime (uvicorn serves API + WS + built SPA + Node sidecar) — the systemd `ExecStart` on deployed VMs || `company stop` | Stop all services and free configured ports |@@ -59,11 +59,11 @@ the source of truth).| Script | Command | Description ||--------|---------|-------------|| `client:start` | `cd client && npm run start` | React frontend (Vite dev server) |-| `python:start` | `cd server && uv run uvicorn main:app --host 127.0.0.1 --port 3010 ...` | Backend only |+| `python:start` | `cd server && uv run uvicorn main:app --host 127.0.0.1 --port 5678 ...` | Backend only || `python:daemon` | same, bound to `0.0.0.0` | Backend only, LAN-reachable || `temporal:worker` | `cd server && uv run python -m services.temporal.worker` | Standalone Temporal worker |-Temporal server lifecycle is managed by `company start` / `company dev` / `company stop` directly (see [Temporal Architecture](./TEMPORAL_ARCHITECTURE.md)). The official `temporal` CLI is downloaded by `pooch` to `<DATA_DIR>/packages/temporal/` (= `~/.opencompany/packages/temporal/` by default) during `company build` and spawned as a supervised subprocess.+The Temporal dev server is backend-owned: the FastAPI lifespan starts it via `TemporalServerRuntime.ensure_started()` when `TEMPORAL_ENABLED` (see [Temporal Architecture](./TEMPORAL_ARCHITECTURE.md)). The official `temporal` CLI is downloaded by `pooch` to `<DATA_DIR>/packages/temporal/` (= `~/.opencompany/packages/temporal/` by default) during `company build`.### Tests@@ -109,11 +109,11 @@ Key variables in `.env` (see `.env.template` for the full list):### Ports| Variable | Default | Description ||----------|---------|-------------|-| `VITE_CLIENT_PORT` | 3000 | Frontend port |-| `PYTHON_BACKEND_PORT` | 3010 | Backend port |-| `WHATSAPP_RPC_PORT` | 9400 | WhatsApp API port |-| `NODEJS_EXECUTOR_PORT` | 3020 | Node.js code-executor sidecar |-| — | 7233 / 8080 | Temporal gRPC / Temporal Web UI |+| `VITE_CLIENT_PORT` | 5679 | Frontend port |+| `PYTHON_BACKEND_PORT` | 5678 | Backend port |+| `WHATSAPP_RPC_PORT` | 5681 | WhatsApp API port |+| `NODEJS_EXECUTOR_PORT` | 5680 | Node.js code-executor sidecar |+| — | 5682 / 5683 | Temporal gRPC / Temporal Web UI |### Features| Variable | Default | Description |@@ -138,9 +138,9 @@ Key variables in `.env` (see `.env.template` for the full list):```bash# Development-company dev # Vite HMR + backend + temporal+company dev # Vite HMR (:5679) + backend (:5678)company dev --force # ...forcing a Vite dependency re-bundle-company start # Production mode (static client)+company start # Production mode (single port :5678)company stop # Stop all services# Build / cleandiff --git a/docs-internal/SETUP.md b/docs-internal/SETUP.mdindex e82e22a3..3563abf0 100644--- a/docs-internal/SETUP.md+++ b/docs-internal/SETUP.md@@ -7,12 +7,12 @@ OpenCompany/├── client/ # React frontend (Vite dev server on port 3000; production build served by the backend)│ ├── src/│ └── package.json-├── server/ # Python FastAPI backend (port 3010)+├── server/ # Python FastAPI backend (port 5678)│ ├── services/ # Business logic (workflow, AI, etc.)│ ├── routers/ # API endpoints│ ├── core/ # DI container, database, cache│ ├── models/ # SQLModel definitions-│ ├── whatsapp-rpc/ # Go WhatsApp service (port 9400)+│ ├── whatsapp-rpc/ # Go WhatsApp service (port 5681)│ └── requirements.txt├── scripts/ # Build and utility scripts└── package.json # Workspace root with npm scripts@@ -25,7 +25,7 @@ npm install -g @zeenie-ai/opencompanycompany start```-Open http://localhost:3010 — `company start` is single-port (API ++Open http://localhost:5678 — `company start` is single-port (API +WebSocket + built SPA on the backend port).### Local Development (from source)@@ -49,11 +49,11 @@ cd server && uv sync --extra local-embeddings```Services (production `company start`):-- **App (API + WS + SPA)**: http://localhost:3010-- **WhatsApp Service**: http://localhost:9400 (backend-spawned on demand)-- **Temporal dev server**: gRPC :7233, Web UI :8080 (backend-spawned when `TEMPORAL_ENABLED`)+- **App (API + WS + SPA)**: http://localhost:5678+- **WhatsApp Service**: http://localhost:5681 (backend-spawned on demand)+- **Temporal dev server**: gRPC :5682, Web UI :5683 (backend-spawned when `TEMPORAL_ENABLED`)-`company dev` additionally runs the Vite HMR client at http://localhost:3000.+`company dev` additionally runs the Vite HMR client at http://localhost:5679.## Services Overview@@ -63,7 +63,7 @@ Services (production `company start`):- Zustand for state management- WebSocket connection to backend-### Backend (Python FastAPI - Port 3010)+### Backend (Python FastAPI - Port 5678)- FastAPI with async support- SQLAlchemy + SQLite database- Native Anthropic and Google Gen AI providers plus the OpenAI SDK for OpenAI-compatible chat through `ChatUnifier`; Ollama's SDK is used for local model discovery and embeddings@@ -86,7 +86,7 @@ Services (production `company start`):- Provides durable workflow execution with per-node retry and horizontal scaling- Official `temporal` CLI downloaded by `pooch` from `https://temporal.download/cli/archive/latest` on `company build` (or first backend boot with Temporal enabled)- Backend-owned: the FastAPI lifespan starts `temporal server start-dev` via `TemporalServerRuntime.ensure_started()` when `TEMPORAL_ENABLED` and the configured address is loopback (external clusters are detected via TCP probe and left alone) — SQLite at `~/.opencompany/temporal.db`-- Ports: gRPC 7233, Web UI 8080+- Ports: gRPC 5682, Web UI 5683- Embedded worker runs inside Python backend (`TemporalWorkerManager` in `main.py`)- Workflow auto-resumption disabled at startup (history preserved); see `TEMPORAL_TERMINATE_RUNNING_ON_STARTUP`- See [Temporal Architecture](./TEMPORAL_ARCHITECTURE.md) and [CLI Services Guide](./cli_services_integration.md)@@ -112,8 +112,8 @@ Alternatively, `company build` scaffolds `.env` from `.env.template` automatical| Variable | Default | Description ||----------|---------|-------------|-| `VITE_CLIENT_PORT` | 3000 | Frontend port |-| `PYTHON_BACKEND_PORT` | 3010 | Backend API port |+| `VITE_CLIENT_PORT` | 5679 | Frontend port |+| `PYTHON_BACKEND_PORT` | 5678 | Backend API port || `AUTH_MODE` | single | Authentication mode (single/multi) || `REDIS_ENABLED` | false | Enable Redis cache (production) || `DEBUG` | true | Debug mode |@@ -155,8 +155,8 @@ When `VITE_AUTH_ENABLED=false` (the default):### Port already in useChange the port in `.env`:```bash-VITE_CLIENT_PORT=3001-PYTHON_BACKEND_PORT=3011+VITE_CLIENT_PORT=6679+PYTHON_BACKEND_PORT=6678```### Python dependencies faildiff --git a/docs-internal/TEMPORAL_ARCHITECTURE.md b/docs-internal/TEMPORAL_ARCHITECTURE.mdindex 65125ab2..a306592b 100644--- a/docs-internal/TEMPORAL_ARCHITECTURE.md+++ b/docs-internal/TEMPORAL_ARCHITECTURE.md@@ -49,7 +49,7 @@ This invokes `run_standalone_worker()` from `services/temporal/worker.py`.## System Architecture```- TEMPORAL SERVER (port 7233)+ TEMPORAL SERVER (port 5682)|Task Queue: machina-tasks (workflows + framework activities)+---------------------------------------------------------------+@@ -577,7 +577,7 @@ client = await Client.connect(server_address, namespace=namespace, runtime=runtiThe Temporal binary + persistence are managed in-process by the plugin-folder pattern at [`server/services/temporal/`](../server/services/temporal/). Single supervised process — the official `temporal` CLI's `server start-dev` mode, per [docs.temporal.io/develop/python/set-up-your-local-python](https://docs.temporal.io/develop/python/set-up-your-local-python). Five sibling files (`_install.py`, `_runtime.py`, `_handlers.py`, `_refresh.py`, `client.py`, plus `__init__.py` for registry wiring) match the [Wave 11 plugin-folder pattern](./plugin_system.md#self-contained-plugin-folders) that `server/nodes/whatsapp/` uses for its Go binary.-**What runs**: one process — `temporal server start-dev --port 7233 --ui-port 8080 --db-filename ~/.opencompany/temporal.db --namespace default`. Both gRPC + Web UI bind to the same process (per docs.temporal.io/cli/server — "all running in a single process"). SQLite-backed durability; history persisted across restarts.+**What runs**: one process — `temporal server start-dev --port 5682 --ui-port 5683 --db-filename ~/.opencompany/temporal.db --namespace default`. Both gRPC + Web UI bind to the same process (per docs.temporal.io/cli/server — "all running in a single process"). SQLite-backed durability; history persisted across restarts.**Modern libs doing the heavy lifting** (zero custom infrastructure code):- **[`pooch`](https://pypi.org/project/pooch/)** — `services/temporal/_install.py` downloads the official `temporal` CLI archive from `https://temporal.download/cli/archive/latest?platform=<os>&arch=<arch>`. Cross-platform (Windows zip / macOS+Linux tar.gz), cached at `<DATA_DIR>/packages/temporal/` via `_cache_dir() = core.paths.package_dir("temporal")` (pooch's `path=` argument). The retrieve call passes an explicit `downloader=pooch.HTTPDownloader(timeout=300, progressbar=True)`: the timeout is per-socket-read (not total transfer), so arbitrarily slow links can finish the ~114 MB fetch — pooch's 30 s default aborted them — and `progressbar` must live on the downloader because `retrieve()` ignores its own kwarg when `downloader=` is explicit. Failed downloads never poison the cache (pooch writes to a temp file and renames atomically on success). Standalone entry: `python -m services.temporal._install` — invoked **fatally** by `company build` step [6/6] (so first `company start` doesn't pay the download; contract locked by `test_temporal_install_is_fatal_on_failure`) and **non-fatally** by npm postinstall (`scripts/install.js` try/catch — `TemporalServerRuntime._pre_spawn()` re-downloads lazily on first `company start`, so a failed eager fetch never fails `npm install -g`). The binary cache survives `company clean` (`packages` is in `_OPENCOMPANY_KEEP`, `cli/commands/clean.py`). Pre-fix this used `pooch.os_cache("opencompany-temporal")` (`~/.cache/OpenCompany/opencompany-temporal/` etc.) — a separate OS-cache namespace operators reported as "not local"; it now sits under DATA_DIR alongside the Stripe binary and the shared npm tree.@@ -589,7 +589,7 @@ The Temporal binary + persistence are managed in-process by the plugin-folder pa**Resumption toggle**: [`TemporalClientWrapper.terminate_running_workflows`](../server/services/temporal/client.py) — runs once at server lifespan startup, between client connect and worker start, gated on `TEMPORAL_TERMINATE_RUNNING_ON_STARTUP` (default `true`). Queries Visibility for every `Running` workflow and calls `handle.terminate(reason="OpenCompany startup: auto-resumption disabled")`. **History is preserved** (UI shows workflows as `Terminated`, not deleted); only active execution stops. Disables resumption while `DeploymentManager` has no boot-time reconcile against Temporal Visibility yet — resumed workflows would otherwise keep executing but be invisible to the OpenCompany UI. Flip to `false` once the reconcile lands.-**Port management**: Temporal owns ports 7233 (gRPC) + 8080 (Web UI). Both bound by the same `temporal.exe` process; both listed in `cli.config.Config.all_ports` so `company stop`'s port-freeing pre-flight covers them.+**Port management**: Temporal owns ports 5682 (gRPC) + 5683 (Web UI). Both bound by the same `temporal.exe` process; both listed in `cli.config.Config.all_ports` so `company stop`'s port-freeing pre-flight covers them.**Direct CLI access**: the pooch-installed `temporal` binary lives under `<DATA_DIR>/packages/temporal/` (= `~/.opencompany/packages/temporal/` by default, on every OS). Run `temporal --version`, `temporal workflow list`, etc. directly from there.@@ -598,13 +598,13 @@ The Temporal binary + persistence are managed in-process by the plugin-folder pa| Setting | Env var | `.env.template` default | Purpose ||---|---|---|---|| `temporal_enabled` | `TEMPORAL_ENABLED` | `true` | Master toggle. When false, `WorkflowService` falls back to the sequential executor. |-| `temporal_server_address` | `TEMPORAL_SERVER_ADDRESS` | `localhost:7233` | Address the Python SDK client connects to. |+| `temporal_server_address` | `TEMPORAL_SERVER_ADDRESS` | `localhost:5682` | Address the Python SDK client connects to. || `temporal_namespace` | `TEMPORAL_NAMESPACE` | `default` | Bootstrapped at server start. || `temporal_task_queue` | `TEMPORAL_TASK_QUEUE` | `machina-tasks` | Default task queue for the embedded worker. || `temporal_per_type_dispatch` | `TEMPORAL_PER_TYPE_DISPATCH` | `true` | F4.A flag — per-type activity dispatch. || `temporal_agent_workflow_enabled` | `TEMPORAL_AGENT_WORKFLOW_ENABLED` | `true` | F4.B flag — agent-as-child-workflow. |-| `temporal_frontend_grpc_port` | `TEMPORAL_FRONTEND_GRPC_PORT` | `7233` | gRPC port (`--port`). Drives the readiness probe. |-| `temporal_ui_port` | `TEMPORAL_UI_PORT` | `8080` | Web UI port (`--ui-port`). CLI default is `--port + 1000 = 8233`; we override to 8080 for muscle memory. |+| `temporal_frontend_grpc_port` | `TEMPORAL_FRONTEND_GRPC_PORT` | `5682` | gRPC port (`--port`). Drives the readiness probe. |+| `temporal_ui_port` | `TEMPORAL_UI_PORT` | `5683` | Web UI port (`--ui-port`). CLI default is `--port + 1000`; pinned into the serial 5678-block instead. || `temporal_sqlite_path` | `TEMPORAL_SQLITE_PATH` | `temporal.db` | SQLite file (`--db-filename`). Resolved relative to `DATA_DIR` (= `~/.opencompany/`) unless absolute — flat under `~/.opencompany/` like `credentials.db` / `workflow.db`. || `temporal_graceful_shutdown_seconds` | `TEMPORAL_GRACEFUL_SHUTDOWN_SECONDS` | `30` | `CTRL_BREAK_EVENT` (Windows) / `SIGTERM` (POSIX) → tree-kill grace window. Shared with the embedded worker shutdown. || `temporal_terminate_running_on_startup` | `TEMPORAL_TERMINATE_RUNNING_ON_STARTUP` | `true` | Resumption toggle (see above). |@@ -622,7 +622,7 @@ through `Settings`:## Debugging-The Web UI is at http://localhost:8080; the UI's HTTP API is served at http://localhost:8233.+The Web UI is at http://localhost:5683; the UI's HTTP API rides the gRPC port + 1000 (6682).### Reading Temporal tracing output@@ -671,10 +671,10 @@ duplicate execution.```bash# Temporal Web UI-open http://localhost:8080+open http://localhost:5683# List workflows via the local CLI binary (under <DATA_DIR>/packages/temporal/)-~/.opencompany/packages/temporal/.../temporal.exe workflow list --address localhost:7233+~/.opencompany/packages/temporal/.../temporal.exe workflow list --address localhost:5682# Re-fetch the binary at any timeuv run python -m services.temporal._installdiff --git a/docs-internal/ci_cd.md b/docs-internal/ci_cd.mdindex bc3520bd..b8c2f11a 100644--- a/docs-internal/ci_cd.md+++ b/docs-internal/ci_cd.md@@ -87,7 +87,7 @@ Reusable `workflow_call` workflow with four independent jobs (no plan/change-det- `build-and-lint` — `pnpm install --frozen-lockfile` + `pnpm run build`, then client lint (`pnpm --filter react-flow-client run lint`), TypeScript check (`... run typecheck`), and frontend tests (`... run test`, vitest). Runs on `ubuntu-latest`.- `backend-tests` — `uv sync` + `uv run pytest tests/ -v` in `server/`. Whole suite, unsharded. Runs on `ubuntu-latest`.- `cli-tests` — `uv pip install --system pytest pytest-asyncio pyyaml` + `python -m pytest cli/tests/ -v`. Runs on `ubuntu-latest`.-- `test-build-start` — cross-OS matrix (`ubuntu-latest`, `macos-latest`, `windows-latest`, `fail-fast: false`). Runs `pnpm run build`, then a start smoke test. On Unix it backgrounds `pnpm run start`, polls `http://localhost:3010/health` for up to ~30 s, then `pnpm run stop`. On Windows it starts the supervisor as a background job, waits 15 s, and fails if the job already exited.+- `test-build-start` — cross-OS matrix (`ubuntu-latest`, `macos-latest`, `windows-latest`, `fail-fast: false`). Runs `pnpm run build`, then a start smoke test. On Unix it backgrounds `pnpm run start`, polls `http://localhost:5678/health` for up to ~30 s, then `pnpm run stop`. On Windows it starts the supervisor as a background job, waits 15 s, and fails if the job already exited.---diff --git a/docs-internal/cli_services_integration.md b/docs-internal/cli_services_integration.mdindex 198f9c52..9ebdcb05 100644--- a/docs-internal/cli_services_integration.md+++ b/docs-internal/cli_services_integration.md@@ -23,8 +23,8 @@ Wraps the official `temporal` CLI's `server start-dev` mode (per [docs.temporal.**Ports (declared in `.env.template`, freed by `company stop`'s port-kill pre-flight):**| Service | Port | Env var ||---------|------|---------|-| gRPC | 7233 | `TEMPORAL_FRONTEND_GRPC_PORT` |-| Web UI | 8080 | `TEMPORAL_UI_PORT` (CLI default is 8233; we override) |+| gRPC | 5682 | `TEMPORAL_FRONTEND_GRPC_PORT` |+| Web UI | 5683 | `TEMPORAL_UI_PORT` (CLI default is 8233; we override) |Both bound by the same `temporal.exe` process. Killing the process releases both.diff --git a/docs-internal/credentials_panel.md b/docs-internal/credentials_panel.mdindex 425cd788..a7a0ba37 100644--- a/docs-internal/credentials_panel.md+++ b/docs-internal/credentials_panel.md@@ -181,7 +181,7 @@ No logout WebSocket handler — user can manually delete the credentials file or### 2.7 Pattern G — QR pairing (WhatsApp)-**Credentials stored**: nothing in OpenCompany DB. Session lives inside the bundled `whatsapp-rpc` Go service (default port 9400).+**Credentials stored**: nothing in OpenCompany DB. Session lives inside the bundled `whatsapp-rpc` Go service (default port 5681).**Happy path**:```@@ -346,7 +346,7 @@ Provider × table examples:`encrypt(plaintext) -> str` / `decrypt(ciphertext) -> str`. Decryption raises `ValueError` on tampering/wrong-key, `RuntimeError` if `initialize()` was never called.### 4.5 Runtime redirect URI derivation-[server/services/oauth_utils.py](../server/services/oauth_utils.py) `get_redirect_uri(connection, provider)` derives the OAuth callback URI from the live `WebSocket.base_url` (or `Request.base_url`) — converting `ws(s)` to `http(s)` and appending the path from `config/google_apis.json`. No hardcoded hostnames or ports. Works in dev (`http://localhost:3010/api/google/callback`) and prod (`https://flow.zeenie.xyz/api/google/callback`) without env vars.+[server/services/oauth_utils.py](../server/services/oauth_utils.py) `get_redirect_uri(connection, provider)` derives the OAuth callback URI from the live `WebSocket.base_url` (or `Request.base_url`) — converting `ws(s)` to `http(s)` and appending the path from `config/google_apis.json`. No hardcoded hostnames or ports. Works in dev (`http://localhost:5678/api/google/callback`) and prod (`https://flow.zeenie.xyz/api/google/callback`) without env vars.---diff --git a/docs-internal/errors.md b/docs-internal/errors.mdindex 4518d557..172e4d13 100644--- a/docs-internal/errors.md+++ b/docs-internal/errors.md@@ -6,7 +6,7 @@ Documented root causes and fixes for errors encountered in OpenCompany developme## 1. SQLAlchemy Import Hang (Windows)-**Symptom**: Backend hangs at startup with no output after `Importing DI container + all services...`. The process is alive but never binds port 3010. `import sqlalchemy` blocks indefinitely.+**Symptom**: Backend hangs at startup with no output after `Importing DI container + all services...`. The process is alive but never binds port 5678. `import sqlalchemy` blocks indefinitely.**Root cause**: Git worktrees nested inside the project root (e.g., `.claude/worktrees/`) cause Windows Defender real-time scanning to fan out across all worktree directories when Python loads `.pyd` (native DLL) files. SQLAlchemy has 5 Cython `.pyd` files (`collections`, `immutabledict`, `processors`, `resultproxy`, `util`) loaded sequentially during import. Defender's scan queue backs up across the worktree copies, blocking `LoadLibrary()` for minutes per file.@@ -188,7 +188,7 @@ Also changed `receive_timeout=540` to `receive_timeout=None` on `ws_connect()` -**Symptom**: Backend logs show:```-WhatsApp RPC timeout - Go service not responding at ws://localhost:9400/ws/rpc+WhatsApp RPC timeout - Go service not responding at ws://localhost:5681/ws/rpc```WhatsApp service health check (`/health`) returns 200 OK, but the WebSocket RPC connection fails.@@ -212,7 +212,7 @@ self.ws = await asyncio.wait_for(**Symptom**: After `pnpm run dev`, browser console shows repeated errors:```-GET http://localhost:3010/api/auth/status net::ERR_CONNECTION_REFUSED+GET http://localhost:5678/api/auth/status net::ERR_CONNECTION_REFUSEDFailed to check auth status (attempt 4/6): TypeError: Failed to fetch```diff --git a/docs-internal/event_framework.md b/docs-internal/event_framework.mdindex 24e239db..2682884b 100644--- a/docs-internal/event_framework.md+++ b/docs-internal/event_framework.md@@ -235,7 +235,7 @@ inspection surface:- **Visibility list**: `client.list_workflows(query="ExecutionStatus='Failed' AND EventWorkflowId='<deployment_workflow_id>'")` returns every failed run for a deployment. The same Search Attributes the cancel sweep uses for cleanup (per `services/temporal/search_attributes.py`) make this query work.- **Failure detail**: `client.get_workflow_history(workflow_id, run_id)` returns the full Event History, including the `ActivityTaskFailed` event's error message + stacktrace + each retry attempt timestamp.-- **Temporal Web UI**: http://localhost:8233 — the same data, browsable.+- **Temporal Web UI**: http://localhost:5683 — the same data, browsable.This is why Wave 12 explicitly does NOT add a custom `event_dlq` SQLModel table. Doing so would reinvent the Temporal primitives the rest of the framework was built AROUND, not against. The pre-Temporal `services/execution/models.py::DLQEntry` for the legacy `WorkflowExecutor` is a separate concern and stays where it is.diff --git a/docs-internal/gcp_vm_deploy_runbook.md b/docs-internal/gcp_vm_deploy_runbook.mdindex ec91ff9a..c1311361 100644--- a/docs-internal/gcp_vm_deploy_runbook.md+++ b/docs-internal/gcp_vm_deploy_runbook.md@@ -62,9 +62,11 @@ print('ENC='+secrets.token_hex(24))"tested shape remains `company start` (static client on **:3000**, backend uvicornon **:3010**) plus an nginx reverse proxy on :80/:443 — it works on every release.**Releases after 0.0.95**: `company start` became single-port itself (uvicorn- serves the SPA on :3010; no :3000 static server). When upgrading a VM past- 0.0.95, change the nginx `location /` block to `proxy_pass http://127.0.0.1:3010;`- (same target as `/api/`) and reload nginx.+ serves the SPA; no :3000 static server) AND the default ports moved to the+ serial 5678 block (backend :5678, WhatsApp :5681, Temporal :5682/:5683).+ When upgrading a VM past 0.0.95, point EVERY nginx `proxy_pass` in step 2+ (`/api/`, `/ws/`, `/webhook/`, `/health`, and `location /`) at+ `http://127.0.0.1:5678;` and reload nginx.3. **Owner env seeding requires `>= 0.0.95`.** 0.0.88 ignored `MACHINA_OWNER_*`entirely. Since 0.0.95 the backend seeds the owner at startup from`OPENCOMPANY_OWNER_EMAIL` + `OPENCOMPANY_OWNER_PASSWORD` (>= 8 chars;@@ -408,7 +410,8 @@ gcloud compute ssh <VM_NAME> --zone=<ZONE> --quiet --command="sudo systemctl resgcloud compute ssh <VM_NAME> --zone=<ZONE> --quiet --command="sudo npm install -g @zeenie-ai/opencompany@latest && sudo systemctl restart opencompany"# flip an env toggle (sudo on EVERY command touching the 600 env file - pitfall 13c):gcloud compute ssh <VM_NAME> --zone=<ZONE> --quiet --command="sudo sed -i 's/TEMPORAL_ENABLED=false/TEMPORAL_ENABLED=true/' /etc/opencompany/opencompany.env; sudo systemctl restart opencompany"-# Temporal Web UI (localhost-bound on the VM; gRPC :7233, UI :8080):+# Temporal Web UI (localhost-bound on the VM; gRPC :7233, UI :8080 on+# releases <= 0.0.95; :5682/:5683 after the serial-port change):gcloud compute ssh <VM_NAME> --zone=<ZONE> --tunnel-through-iap -- -L 8080:localhost:8080# then open http://localhost:8080. Note: `company start` runs the Temporal dev# server regardless of TEMPORAL_ENABLED; the flag only controls whether thediff --git a/docs-internal/new_service_integration.md b/docs-internal/new_service_integration.mdindex 745164a9..730ed620 100644--- a/docs-internal/new_service_integration.md+++ b/docs-internal/new_service_integration.md@@ -123,7 +123,7 @@ class ServiceOAuth:self,client_id: str,client_secret: str,- redirect_uri: str = "http://localhost:3010/api/{service}/callback",+ redirect_uri: str = "http://localhost:5678/api/{service}/callback",scopes: Optional[List[str]] = None,):self.client_id = client_iddiff --git a/docs-internal/performance.md b/docs-internal/performance.mdindex 7a842c78..223e0f07 100644--- a/docs-internal/performance.md+++ b/docs-internal/performance.md@@ -14,7 +14,7 @@ warm OS file cache, with bytecode pre-compile applied:| Metric | Value | Source ||---|---|---|| Application startup complete | **2.90 s** | `start.log` 14:38 (post-`e77215c`, May 6 2026) |-| HTTP `ready on port 3010` | **3.17 s** | same |+| HTTP `ready on port 5678` | **3.17 s** | same || First WebSocket client connected | **8.29 s** | same || Status broadcasters fully settled | **12.27 s** | same || AIService import (warm) | **703 ms** | same — was ~31 s on v0.0.75 |@@ -69,7 +69,7 @@ T+2.25 — Lifespan startup├── Compaction service (0.12 s)└── All services initialized (2.63 s)T+2.90 — Application startup complete ◀ HTTP-ready point-T+3.17 — `ready on port 3010` (uvicorn accepting)+T+3.17 — `ready on port 5678` (uvicorn accepting)T+3.85 — Temporal worker started (background)├── ... (auth state propagates to FE; React mounts; queries fire)T+8.29 — First WebSocket client connected ◀ UI-interactive point@@ -93,7 +93,7 @@ T+8.7 — 152 node plugins loaded (was 10.8 s → 4.7 s segment)T+11.9 — Lifespan startup begin (3.2 s gap: CLI-agent MCP mount)T+21.5 — Application startup complete (lifespan 9.6 s: fresh-DB init 4.4 s,salt/PBKDF2 + encryption ~3 s — see follow-ups)-T+22.2 — ready on port 3010 (pre-fix: probe timed out at 30 s,+T+22.2 — ready on port 5678 (pre-fix: probe timed out at 30 s,line never printed)T+27 — Temporal worker registered; worker_start span 7.6 s wall but OFF-LOOP:broadcaster refreshes + WhatsApp RPC handshake interleave mid-hash@@ -106,7 +106,7 @@ T+51 — example workflows imported (still inline — see follow-ups)## The remaining +5 s gap (HTTP-ready → first WS connect)-`ready on port 3010` at +3.17 s, first WS connect at +8.29 s. Backend+`ready on port 5678` at +3.17 s, first WS connect at +8.29 s. Backendis idle in this window; the cost lives on the frontend. Likelycontributors:@@ -198,7 +198,7 @@ company start > start.log 2>&1Then extract phase markers:```bash-grep -E "Freeing ports|Importing FastAPI|AIService imported|All imports complete|Lifespan startup begin|Application startup complete|ready on port 3010|StatusBroadcaster\] Client connected|broadcaster.refresh_all_services" start.log+grep -E "Freeing ports|Importing FastAPI|AIService imported|All imports complete|Lifespan startup begin|Application startup complete|ready on port 5678|StatusBroadcaster\] Client connected|broadcaster.refresh_all_services" start.log```### Bundle size + chunk shape@@ -249,7 +249,7 @@ Tracked but explicitly **not** in any active plan.| Plugin walker lazy-loading | ~0.5-0.8 s on server-ready | Would need to defer registration until first NodeSpec request rather than at module-import time. Touches every `BaseNode` subclass — biggest blast radius of the candidates. || Retire legacy Temporal history adapters after the rollback / retention window | negligible startup impact | New executions already use native messages and the compatibility imports are lazy. This is dependency and maintenance cleanup, not a measured cold-start win. || `+5 s` HTTP-ready → first-WS-connect gap | up to 5 s | Diagnostics needed (see "remaining +5 s gap"). May reveal nothing actionable. |-| Supervisor backend `ready_timeout` (default 30 s, shortest of the three services) | cosmetic | The probe is inert (one-shot, no restart/gating) but a >30 s boot prints an alarming "timed out waiting for port 3010" and skips the ready line. Post-fix boots fit the window; revisit only if cold boots regress past 30 s. |+| Supervisor backend `ready_timeout` (default 30 s, shortest of the three services) | cosmetic | The probe is inert (one-shot, no restart/gating) but a >30 s boot prints an alarming "timed out waiting for port 5678" and skips the ready line. Post-fix boots fit the window; revisit only if cold boots regress past 30 s. || Standalone Nuitka / PyOxidizer release binary | full Python interpreter init (~0.4 s) + `.pyc` regeneration on cold disk | User explicitly declined when scoping the build pipeline; revisit if "ship a single binary" becomes a product requirement. |## Referencesdiff --git a/docs-internal/release_build_pipeline.md b/docs-internal/release_build_pipeline.mdindex d01363e8..65cae473 100644--- a/docs-internal/release_build_pipeline.md+++ b/docs-internal/release_build_pipeline.md@@ -114,7 +114,7 @@ Idempotent on re-runs (compileall only rewrites stale pyc; esbuild is determinis4. `cd server && uv run python -m compileall -q -j 0 services` → plain `__pycache__/*.pyc` present (no `.opt-1.pyc` — nothing loads those).5. Cold-start: clean install + `company start > start.log 2>&1` → `Application startup complete` at ≤+50s (was +66.9s).6. `npm pack --dry-run` → `server/nodejs/dist/index.js` included; no `__pycache__/`; tarball size ≤ v0.0.76.-7. Smoke: `company start` → load http://localhost:3010 → run "AI Assistant" example → agent responds.+7. Smoke: `company start` → load http://localhost:5678 → run "AI Assistant" example → agent responds.## Out of scope (future work)diff --git a/docs-internal/server-readme.md b/docs-internal/server-readme.mdindex f9b5a788..13c428c7 100644--- a/docs-internal/server-readme.md+++ b/docs-internal/server-readme.md@@ -118,8 +118,8 @@ Google Workspace services (Gmail, Calendar, Drive, Sheets, Tasks, Contacts) shar### Environment Variables (Optional)```bash-# Custom OAuth redirect URI (defaults to localhost:3010)-GOOGLE_REDIRECT_URI=http://localhost:3010/api/google/callback+# Custom OAuth redirect URI (defaults to localhost:5678)+GOOGLE_REDIRECT_URI=http://localhost:5678/api/google/callback```### Token Storagediff --git a/docs-internal/stripe_service.md b/docs-internal/stripe_service.mdindex 918e3e5f..084c56c3 100644--- a/docs-internal/stripe_service.md+++ b/docs-internal/stripe_service.md@@ -836,7 +836,7 @@ End-to-end smoke (requires Stripe CLI installed and a Stripe account):"create a Stripe test customer with email [email protected]"; theLLM emits a `stripeAction.run` tool call.7. **Signature failure.**- `curl -X POST -H "Stripe-Signature: t=0,v1=garbage" http://localhost:3010/webhook/stripe -d '{}'`+ `curl -X POST -H "Stripe-Signature: t=0,v1=garbage" http://localhost:5678/webhook/stripe -d '{}'`returns 400; no event dispatched.8. **Logout.** Credentials Modal → Disconnect. Confirm`process_service.list_processes("_stripe_global")` is empty ANDdiff --git a/scripts/postinstall.js b/scripts/postinstall.jsindex 56070182..4291aedb 100755--- a/scripts/postinstall.js+++ b/scripts/postinstall.js@@ -128,7 +128,7 @@ async function main() {console.log('========================================');console.log('');console.log('Run: company start');- console.log('Open: http://localhost:3010');+ console.log('Open: http://localhost:5678');console.log('');} catch (err) {diff --git a/server/config/credential_providers.json b/server/config/credential_providers.jsonindex 0176a0d3..762cd104 100644--- a/server/config/credential_providers.json+++ b/server/config/credential_providers.json@@ -256,7 +256,7 @@"placeholder": "Client Secret (optional for PKCE)"}],- "callback_url": "http://localhost:3010/api/twitter/callback",+ "callback_url": "http://localhost:5678/api/twitter/callback","instructions": "Get credentials from the X Developer Portal. Create an app with OAuth 2.0 enabled."},@@ -331,7 +331,7 @@"required": true}],- "callback_url": "http://localhost:3010/api/google/callback",+ "callback_url": "http://localhost:5678/api/google/callback","instructions": "Get credentials from Google Cloud Console. Enable Gmail, Calendar, Drive, Sheets, Tasks, and People APIs."},diff --git a/server/config/llm_defaults.json b/server/config/llm_defaults.jsonindex eee56698..d1e06fe9 100644--- a/server/config/llm_defaults.json+++ b/server/config/llm_defaults.json@@ -130,7 +130,7 @@"models_endpoint": "https://openrouter.ai/api/v1/models","api_key_param": "api_key","max_tokens_param": "max_tokens",- "extra_headers": {"HTTP-Referer": "http://localhost:3000", "X-Title": "OpenCompany"},+ "extra_headers": {"HTTP-Referer": "http://localhost:5678", "X-Title": "OpenCompany"},"max_output_tokens": {"_default": 4096},diff --git a/server/core/config.py b/server/core/config.pyindex a626cc48..1e43e3f5 100644--- a/server/core/config.py+++ b/server/core/config.py@@ -172,9 +172,9 @@ class Settings(BaseSettings):le=65535,)# Web UI port. ``temporal server start-dev`` defaults this to- # ``--port + 1000`` (i.e. 8233 alongside the default 7233 gRPC- # port); declared explicitly via ``--ui-port`` so the binding is- # intentional and surfaces in status snapshots.+ # ``--port + 1000``; declared explicitly via ``--ui-port`` (5683 in+ # the serial 5678-block) so the binding is intentional and surfaces+ # in status snapshots.temporal_ui_port: int = Field(env="TEMPORAL_UI_PORT",ge=1024,@@ -248,9 +248,9 @@ class Settings(BaseSettings):google_ai_api_key: Optional[str] = Field(default=None, env="GOOGLE_AI_API_KEY")# Node.js Executor Configuration- nodejs_executor_url: str = Field(default="http://localhost:3020", env="NODEJS_EXECUTOR_URL")+ nodejs_executor_url: str = Field(default="http://localhost:5680", env="NODEJS_EXECUTOR_URL")nodejs_executor_timeout: int = Field(default=30, env="NODEJS_EXECUTOR_TIMEOUT", ge=5, le=300)- nodejs_executor_port: int = Field(default=3020, env="NODEJS_EXECUTOR_PORT", ge=1024, le=65535)+ nodejs_executor_port: int = Field(default=5680, env="NODEJS_EXECUTOR_PORT", ge=1024, le=65535)# AI Proxy Configuration (Ollama-style proxy)ai_proxy_default_port: int = Field(default=11434, env="AI_PROXY_DEFAULT_PORT")@@ -347,7 +347,7 @@ class Settings(BaseSettings):# session DB lives under data_dir, surviving pnpm install / version bumps)whatsapp_runtime_enabled: bool = Field(default=True, env="WHATSAPP_RUNTIME_ENABLED")whatsapp_data_subdir: str = Field(default="whatsapp", env="WHATSAPP_DATA_SUBDIR")- whatsapp_port: int = Field(default=9400, env="WHATSAPP_RPC_PORT", ge=1024, le=65535)+ whatsapp_port: int = Field(default=5681, env="WHATSAPP_RPC_PORT", ge=1024, le=65535)whatsapp_binary_path: Optional[str] = Field(default=None, env="WHATSAPP_BINARY_PATH")# `localhost` is the only bind that Windows Firewall's loopback exception# silently allows. Override to "0.0.0.0" for container deployments.diff --git a/server/gunicorn.conf.py b/server/gunicorn.conf.pyindex 723a09ed..d587b502 100644--- a/server/gunicorn.conf.py+++ b/server/gunicorn.conf.py@@ -12,7 +12,7 @@ import multiprocessing# Load from environment (same vars used by config.py)host = os.getenv("HOST", "0.0.0.0")-port = os.getenv("PORT", "3010")+port = os.getenv("PORT", "5678")workers_env = os.getenv("WORKERS", "0") # 0 = auto-calculatelog_level = os.getenv("LOG_LEVEL", "INFO").lower()debug = os.getenv("DEBUG", "false").lower() == "true"diff --git a/server/nodejs/src/index.ts b/server/nodejs/src/index.tsindex a79d4f06..0014e000 100644--- a/server/nodejs/src/index.ts+++ b/server/nodejs/src/index.ts@@ -12,7 +12,7 @@ import { fileURLToPath } from 'node:url';const __dirname = path.dirname(fileURLToPath(import.meta.url));// All configuration from environment variables-const PORT = parseInt(process.env.NODEJS_EXECUTOR_PORT ?? '', 10) || 3020;+const PORT = parseInt(process.env.NODEJS_EXECUTOR_PORT ?? '', 10) || 5680;const HOST = process.env.NODEJS_EXECUTOR_HOST ?? 'localhost';const BODY_LIMIT = process.env.NODEJS_EXECUTOR_BODY_LIMIT ?? '10mb';const USER_PACKAGES_DIR = process.env.NODEJS_USER_PACKAGES_DIR ?? path.join(__dirname, '..', 'user-packages');diff --git a/server/nodes/code/_nodejs.py b/server/nodes/code/_nodejs.pyindex 1fa208e6..c2f1bae8 100644--- a/server/nodes/code/_nodejs.py+++ b/server/nodes/code/_nodejs.py@@ -15,7 +15,7 @@ from services.nodejs_client import NodeJSClient_client: Optional[NodeJSClient] = None-def get_nodejs_client(base_url: str = "http://localhost:3020", timeout: int = 30) -> NodeJSClient:+def get_nodejs_client(base_url: str = "http://localhost:5680", timeout: int = 30) -> NodeJSClient:global _clientif _client is None:_client = NodeJSClient(base_url, timeout)diff --git a/server/nodes/code/javascript_executor/__init__.py b/server/nodes/code/javascript_executor/__init__.pyindex 5991452b..38b1c47c 100644--- a/server/nodes/code/javascript_executor/__init__.py+++ b/server/nodes/code/javascript_executor/__init__.py@@ -43,7 +43,7 @@ class JavaScriptExecutorNode(CodeExecutorBase):# tool can substitute.raise NodeUserError("JavaScript executor is not running (cannot reach the "- "Node.js sidecar on localhost:3020). Start the dev runner "+ "Node.js sidecar on localhost:5680). Start the dev runner ""(it spawns the Node executor automatically), or fall back ""to python_executor for similar logic. Underlying: "f"{exc}"diff --git a/server/nodes/code/typescript_executor/__init__.py b/server/nodes/code/typescript_executor/__init__.pyindex 0fe0d182..bd0372d3 100644--- a/server/nodes/code/typescript_executor/__init__.py+++ b/server/nodes/code/typescript_executor/__init__.py@@ -39,7 +39,7 @@ class TypeScriptExecutorNode(CodeExecutorBase):except ClientConnectorError as exc:raise NodeUserError("TypeScript executor is not running (cannot reach the "- "Node.js sidecar on localhost:3020). Start the dev runner "+ "Node.js sidecar on localhost:5680). Start the dev runner ""(it spawns the Node executor automatically), or fall back ""to python_executor for similar logic. Underlying: "f"{exc}"diff --git a/server/nodes/whatsapp/_runtime.py b/server/nodes/whatsapp/_runtime.pyindex 531c84cd..d9aa4b7e 100644--- a/server/nodes/whatsapp/_runtime.py+++ b/server/nodes/whatsapp/_runtime.py@@ -13,7 +13,7 @@ runs through ``asyncio.to_thread`` in ``_pre_spawn`` so the long``npm install`` (~30 s) doesn't block the asyncio event loop —otherwise the ``StatusBroadcaster._refresh_all_services`` startupfan-out monopolises the loop during boot and uvicorn can't bind-port 3010.+the backend port.Subclasses :class:`BaseProcessSupervisor` for spawning, tree-kill, statussnapshots, restart policy, and the singleton ``get_instance()`` accessor.@@ -66,7 +66,7 @@ class WhatsAppRuntime(BaseProcessSupervisor):@propertydef port(self) -> int:- return int(getattr(self.settings, "whatsapp_port", 9400))+ return int(getattr(self.settings, "whatsapp_port", 5681))@propertydef bind_host(self) -> str:@@ -111,7 +111,7 @@ class WhatsAppRuntime(BaseProcessSupervisor):# blocks on ``subprocess.run`` for the duration of the install;# without this offload the startup ``_refresh_all_services``# fan-out monopolises the loop for ~30 s and uvicorn can't- # bind port 3010 (port-probe times out in the supervisor).+ # bind the backend port (port-probe times out in the supervisor).# Idempotent — instant return when the binary already exists.resolved = await asyncio.to_thread(edgymeow_binary_path)if resolved is None:diff --git a/server/nodes/whatsapp/_service.py b/server/nodes/whatsapp/_service.pyindex 1cf3f37d..05739bc5 100644--- a/server/nodes/whatsapp/_service.py+++ b/server/nodes/whatsapp/_service.py@@ -33,7 +33,7 @@ def qr_code_to_base64(code: str) -> str:logger = logging.getLogger(__name__)-WHATSAPP_RPC_URL = os.getenv("WHATSAPP_RPC_URL", "ws://localhost:9400/ws/rpc")+WHATSAPP_RPC_URL = os.getenv("WHATSAPP_RPC_URL", "ws://localhost:5681/ws/rpc")def extract_phone_from_jid(jid: str | None) -> str | None:@@ -349,7 +349,7 @@ async def get_client(force_reconnect: bool = False, *, spawn: bool = True) -> RPexcept (ConnectionRefusedError, OSError) as e:_client = Nonelogger.error(f"WhatsApp RPC connection refused: {e}")- raise Exception("WhatsApp service not running - start Go whatsmeow service on port 9400")+ raise Exception("WhatsApp service not running - start Go whatsmeow service on port 5681")except Exception as e:_client = Nonelogger.error(f"WhatsApp RPC error: {e}")diff --git a/server/package.json b/server/package.jsonindex ca3d78eb..1ab8c94b 100644--- a/server/package.json+++ b/server/package.json@@ -3,7 +3,7 @@"private": true,"version": "0.0.0","scripts": {- "start": "python -m uvicorn main:app --host 0.0.0.0 --port ${PORT:-3010}",+ "start": "python -m uvicorn main:app --host 0.0.0.0 --port ${PORT:-5678}","dev": "python -m uvicorn main:app --host 127.0.0.1 --port ${PORT:-3010} --reload --reload-dir . --reload-exclude \"*.pyc\" --reload-exclude \"__pycache__\" --log-level warning"},"dependencies": {diff --git a/server/services/ai.py b/server/services/ai.pyindex 5214db06..04401feb 100644--- a/server/services/ai.py+++ b/server/services/ai.py@@ -261,7 +261,7 @@ def _gemini_headers(api_key: str) -> dict:def _openrouter_headers(api_key: str) -> dict:- return {"Authorization": f"Bearer {api_key}", "HTTP-Referer": "http://localhost:3000", "X-Title": "OpenCompany"}+ return {"Authorization": f"Bearer {api_key}", "HTTP-Referer": "http://localhost:5678", "X-Title": "OpenCompany"}def _groq_headers(api_key: str) -> dict:diff --git a/server/services/cli_agent/service.py b/server/services/cli_agent/service.pyindex 84265497..74e6fdaf 100644--- a/server/services/cli_agent/service.py+++ b/server/services/cli_agent/service.py@@ -167,7 +167,7 @@ class AICliService:port = mcp_port or int(os.environ.get("OPENCOMPANY_BACKEND_PORT",- os.environ.get("MACHINA_BACKEND_PORT", "3010"),+ os.environ.get("MACHINA_BACKEND_PORT", "5678"),))ctx = BatchContext(diff --git a/server/services/events/admin_handlers.py b/server/services/events/admin_handlers.pyindex 5b205c79..59ede37f 100644--- a/server/services/events/admin_handlers.py+++ b/server/services/events/admin_handlers.py@@ -185,7 +185,7 @@ async def handle_get_workflow_failure_history(}Ops-only — no replay action available here. For more detail use- Temporal Web UI at http://localhost:8233 or the temporal CLI:+ Temporal Web UI at http://localhost:5683 or the temporal CLI:temporal workflow show --workflow-id <id> --output json"""diff --git a/server/services/llm/providers/openrouter.py b/server/services/llm/providers/openrouter.pyindex 2e03b39d..c8dcfc0c 100644--- a/server/services/llm/providers/openrouter.py+++ b/server/services/llm/providers/openrouter.py@@ -34,7 +34,7 @@ class OpenRouterProvider(OpenAIProvider):"base_url": proxy_url or "https://openrouter.ai/api/v1","max_retries": max(0, int(max_retries)),"default_headers": {- "HTTP-Referer": "http://localhost:3000",+ "HTTP-Referer": "http://localhost:5678","X-Title": "OpenCompany",},}@@ -69,7 +69,7 @@ class OpenRouterProvider(OpenAIProvider):"https://openrouter.ai/api/v1/models",headers={"Authorization": f"Bearer {api_key}",- "HTTP-Referer": "http://localhost:3000",+ "HTTP-Referer": "http://localhost:5678","X-Title": "OpenCompany",},timeout=15.0,diff --git a/server/services/nodejs_client.py b/server/services/nodejs_client.pyindex a31c0b1e..80f668fc 100644--- a/server/services/nodejs_client.py+++ b/server/services/nodejs_client.py@@ -14,7 +14,7 @@ class NodeJSClient:"""Initialize client with base URL and timeout.Args:- base_url: Base URL of Node.js server (e.g., http://127.0.0.1:3020)+ base_url: Base URL of Node.js server (e.g., http://127.0.0.1:5680)timeout: Default request timeout in seconds"""self._base_url = base_url.rstrip("/")diff --git a/server/services/oauth_utils.py b/server/services/oauth_utils.pyindex 8f95ab49..92383961 100644--- a/server/services/oauth_utils.py+++ b/server/services/oauth_utils.py@@ -7,9 +7,9 @@ via ``register_oauth_callback_path("<provider>", "/api/<provider>/callback")``from each plugin's ``__init__.py``); the base URL (scheme + host + port) comesfrom the connection itself.- ws://localhost:3010/ws/status -> http://localhost:3010/api/google/callback+ ws://localhost:5678/ws/status -> http://localhost:5678/api/google/callbackwss://flow.zeenie.xyz/ws/status -> https://flow.zeenie.xyz/api/google/callback- http://localhost:3010/api/google -> http://localhost:3010/api/google/callback+ http://localhost:5678/api/google -> http://localhost:5678/api/google/callback"""from urllib.parse import urlparse@@ -41,7 +41,7 @@ def get_redirect_uri(connection, provider: str) -> str:provider: Lowercase plugin id (``"google"``, ``"twitter"``, ...).Returns:- Full redirect URI, e.g. ``http://localhost:3010/api/google/callback``.+ Full redirect URI, e.g. ``http://localhost:5678/api/google/callback``.Falls back to ``/api/<provider>/callback`` if the plugin hasn'tregistered an explicit path (the default for the existing 8+ plugins)."""diff --git a/server/services/temporal/worker.py b/server/services/temporal/worker.pyindex a6f88746..ca294ff4 100644--- a/server/services/temporal/worker.py+++ b/server/services/temporal/worker.py@@ -545,7 +545,7 @@ class TemporalWorkerPool:async def run_standalone_worker(- server_address: str = "localhost:7233",+ server_address: str = "localhost:5682",namespace: str = "default",task_queue: str = "machina-tasks",pool_size: int = 100,diff --git a/server/tests/credentials/test_google_oauth.py b/server/tests/credentials/test_google_oauth.pyindex 579b03b8..e2e5357e 100644--- a/server/tests/credentials/test_google_oauth.py+++ b/server/tests/credentials/test_google_oauth.py@@ -24,7 +24,7 @@ def oauth():return GoogleOAuth(client_id="test-client-id.apps.googleusercontent.com",client_secret="test-client-secret",- redirect_uri="http://localhost:3010/api/google/callback",+ redirect_uri="http://localhost:5678/api/google/callback",)diff --git a/server/tests/credentials/test_oauth_utils.py b/server/tests/credentials/test_oauth_utils.pyindex c25f0f00..e583f2b7 100644--- a/server/tests/credentials/test_oauth_utils.py+++ b/server/tests/credentials/test_oauth_utils.py@@ -24,19 +24,19 @@ def _conn(base_url: str):class TestGetBaseUrl:def test_ws_scheme_becomes_http(self):- assert get_base_url(_conn("ws://localhost:3010/ws/status")) == "http://localhost:3010"+ assert get_base_url(_conn("ws://localhost:5678/ws/status")) == "http://localhost:5678"def test_wss_scheme_becomes_https(self):assert get_base_url(_conn("wss://flow.zeenie.xyz/ws/status")) == "https://flow.zeenie.xyz"def test_http_scheme_preserved(self):- assert get_base_url(_conn("http://localhost:3010/api/google")) == "http://localhost:3010"+ assert get_base_url(_conn("http://localhost:5678/api/google")) == "http://localhost:5678"def test_https_scheme_preserved(self):assert get_base_url(_conn("https://example.com/anything")) == "https://example.com"def test_strips_trailing_slash(self):- assert get_base_url(_conn("http://localhost:3010/")) == "http://localhost:3010"+ assert get_base_url(_conn("http://localhost:5678/")) == "http://localhost:5678"def test_preserves_non_default_port(self):assert get_base_url(_conn("http://localhost:8080/anything")) == "http://localhost:8080"@@ -51,8 +51,8 @@ class TestGetRedirectUri:@patch("services.oauth_utils.get_oauth_callback_path")def test_google_dev_localhost(self, mock_lookup):mock_lookup.return_value = "/api/google/callback"- uri = get_redirect_uri(_conn("ws://localhost:3010/ws/status"), "google")- assert uri == "http://localhost:3010/api/google/callback"+ uri = get_redirect_uri(_conn("ws://localhost:5678/ws/status"), "google")+ assert uri == "http://localhost:5678/api/google/callback"mock_lookup.assert_called_once_with("google")@patch("services.oauth_utils.get_oauth_callback_path")@@ -66,8 +66,8 @@ class TestGetRedirectUri:"""`get_oauth_callback_path` (the real one, not mocked) fallsback to ``/api/<provider>/callback`` for any unregisteredprovider. Test the integrated path end-to-end."""- uri = get_redirect_uri(_conn("http://localhost:3010/anything"), "newprovider")- assert uri == "http://localhost:3010/api/newprovider/callback"+ uri = get_redirect_uri(_conn("http://localhost:5678/anything"), "newprovider")+ assert uri == "http://localhost:5678/api/newprovider/callback"def test_paths_registered_by_plugins(self):"""Smoke test: the real plugin packages must register thediff --git a/server/tests/credentials/test_twitter_oauth.py b/server/tests/credentials/test_twitter_oauth.pyindex e1cf0ce0..8c64c213 100644--- a/server/tests/credentials/test_twitter_oauth.py+++ b/server/tests/credentials/test_twitter_oauth.py@@ -35,7 +35,7 @@ def oauth():return TwitterOAuth(client_id="test-client-id",client_secret="test-client-secret",- redirect_uri="http://localhost:3010/api/twitter/callback",+ redirect_uri="http://localhost:5678/api/twitter/callback",)@@ -45,7 +45,7 @@ def public_oauth():twitter_oauth._oauth_states.clear()return TwitterOAuth(client_id="test-client-id",- redirect_uri="http://localhost:3010/api/twitter/callback",+ redirect_uri="http://localhost:5678/api/twitter/callback",)@@ -61,7 +61,7 @@ class TestAuthorizationUrl:assert params["code_challenge_method"] == ["S256"]assert params["response_type"] == ["code"]assert params["client_id"] == ["test-client-id"]- assert params["redirect_uri"] == ["http://localhost:3010/api/twitter/callback"]+ assert params["redirect_uri"] == ["http://localhost:5678/api/twitter/callback"]assert "code_challenge" in paramsassert "state" in paramsdiff --git a/server/tests/credentials/test_websocket_handlers.py b/server/tests/credentials/test_websocket_handlers.pyindex cfa0ee22..14d90bee 100644--- a/server/tests/credentials/test_websocket_handlers.py+++ b/server/tests/credentials/test_websocket_handlers.py@@ -33,7 +33,7 @@ pytestmark = pytest.mark.credentialsclass _FakeWebSocket:"""Stand-in for starlette.WebSocket exposing only base_url + client_state."""- def __init__(self, base_url: str = "ws://localhost:3010/ws/status"):+ def __init__(self, base_url: str = "ws://localhost:5678/ws/status"):self.base_url = base_url# mimic starlette WebSocketState.CONNECTEDself.client_state = SimpleNamespace(name="CONNECTED")diff --git a/server/tests/nodes/test_code_fs_process.py b/server/tests/nodes/test_code_fs_process.pyindex a5e7f900..3fe55de6 100644--- a/server/tests/nodes/test_code_fs_process.py+++ b/server/tests/nodes/test_code_fs_process.py@@ -228,7 +228,7 @@ class TestJavascriptExecutor:async def test_http_exception_wrapped_in_envelope(self, harness):_reset_nodejs_singleton()fake_client = MagicMock(name="NodeJSClient")- fake_client.execute = AsyncMock(side_effect=ConnectionRefusedError("Cannot connect to host localhost:3020"))+ fake_client.execute = AsyncMock(side_effect=ConnectionRefusedError("Cannot connect to host localhost:5680"))with patch("nodes.code._nodejs.get_nodejs_client",@@ -237,7 +237,7 @@ class TestJavascriptExecutor:result = await harness.execute("javascriptExecutor", {"code": "output = 1"})harness.assert_envelope(result, success=False)- assert "localhost:3020" in result["error"]+ assert "localhost:5680" in result["error"]# ============================================================================diff --git a/server/tests/services/cli_agent/test_mcp_server.py b/server/tests/services/cli_agent/test_mcp_server.pyindex 9287f096..5962adad 100644--- a/server/tests/services/cli_agent/test_mcp_server.py+++ b/server/tests/services/cli_agent/test_mcp_server.py@@ -228,7 +228,7 @@ class TestLockfile:path = lockfile_path(ide_lockfile_dir=tmp_path,pid=12345,- port=3010,+ port=5678,ide_name="claude",)assert path.name == "12345.lock"@@ -237,25 +237,25 @@ class TestLockfile:path = lockfile_path(ide_lockfile_dir=tmp_path,pid=12345,- port=3010,+ port=5678,ide_name="gemini",)assert "12345" in path.name- assert "3010" in path.name+ assert "5678" in path.nameassert path.name.endswith(".json")def test_lockfile_payload_matches_vscode_shape(self, tmp_path):path = write_ide_lockfile(ide_lockfile_dir=tmp_path,pid=99999,- port=3010,+ port=5678,token="abc123",workspace_dir=tmp_path / "ws",ide_name="claude",)payload = json.loads(path.read_text(encoding="utf-8"))# VSCode-style fields- assert payload["port"] == 3010+ assert payload["port"] == 5678assert payload["authToken"] == "abc123"assert payload["ideName"] == "claude"assert "url" in payload@@ -268,7 +268,7 @@ class TestLockfile:path = write_ide_lockfile(ide_lockfile_dir=tmp_path,pid=1,- port=3010,+ port=5678,token="t",workspace_dir=tmp_path,ide_name="claude",@@ -276,7 +276,7 @@ class TestLockfile:payload = json.loads(path.read_text(encoding="utf-8"))# FastMCP serves at `/mcp` of the sub-app, mounted at `/mcp/ide`.# The lockfile must advertise the absolute JSON-RPC endpoint.- assert payload["url"] == "http://127.0.0.1:3010/mcp/ide/mcp"+ assert payload["url"] == "http://127.0.0.1:5678/mcp/ide/mcp"def test_remove_lockfile_safe_when_missing(self, tmp_path):# Should never raise@@ -298,7 +298,7 @@ class TestLockfile:write_ide_lockfile(ide_lockfile_dir=tmp_path,pid=dead_pid,- port=3010,+ port=5678,token="t",workspace_dir=tmp_path,ide_name="claude",@@ -307,7 +307,7 @@ class TestLockfile:live_path = write_ide_lockfile(ide_lockfile_dir=tmp_path,pid=os.getpid(),- port=3010,+ port=5678,token="t",workspace_dir=tmp_path,ide_name="claude",