Skip to content

Feature/local workspace run#358

Open
zhoumzh wants to merge 8 commits into
openagents-org:developfrom
zhoumzh:feature/local-workspace-run
Open

Feature/local workspace run#358
zhoumzh wants to merge 8 commits into
openagents-org:developfrom
zhoumzh:feature/local-workspace-run

Conversation

@zhoumzh
Copy link
Copy Markdown
Contributor

@zhoumzh zhoumzh commented Apr 24, 2026

🚀 Feature: Full Local Workspace Execution & Dynamic UI Hot-Reloading

📝 Overview

This Pull Request introduces the capability to fully deploy and execute the OpenAgents Workspace (Backend + Frontend) in a localized environment, entirely decoupled from Docker. It also enhances the OpenAgents Launcher by enabling dynamic, runtime configuration of the Workspace Endpoint directly from the Settings UI, streamlining the developer experience and drastically reducing latency.

✨ Key Features & Enhancements

1. 🔄 Dynamic Workspace Switching (Hot-Reloading)

  • UI Configuration: Added a new Default Workspace Endpoint input field in the Launcher's Settings -> Workspaces tab.
  • Immediate Hot-Reload: Changing the endpoint dynamically hot-reloads the core AgentConnector via IPC without requiring a Launcher restart. Developers can seamlessly toggle between production (workspace-endpoint.openagents.org) and local endpoints (http://localhost:8000).

2. 🏠 Localized Workspace Deployment

  • Rapid Local Startup: Added make dev-local-frontend and make dev-local-backend scripts to the Workspace Makefile, allowing developers to spin up the FastAPI backend and Next.js frontend instantly without Docker overhead.
  • Database Migration Fixes: Resolved PostgreSQL UUID type mismatch issues in Alembic migration scripts (005) that caused foreign key failures during initial local schema setup. Provided the missing script.py.mako template to ensure future local autogenerations work flawlessly.

3. 🌐 Intelligent Browser Routing

  • Smart Local Mapping: When an agent is connected to a local workspace (localhost:8000), clicking "Open Workspace in Browser" inside the Launcher now correctly maps the URL to the Next.js local frontend port (http://localhost:3001/...) instead of the production domain, establishing a perfect end-to-end local loop.

🧪 How to Test

  1. Start the local backend: cd workspace && make dev-local-backend
  2. Start the local frontend: cd workspace && make dev-local-frontend
  3. Launch the OpenAgents desktop app: cd packages/launcher && npm run start
  4. Go to Settings -> Workspaces, set the endpoint to http://localhost:8000, and save.
  5. Return to the Dashboard and create/connect a workspace to see the immediate effect against your local backend.

📚 Changelog

  • Maintained detailed notes in changelogs/notes/2026-04-24-local-workspace-run.md.
  • Appended features to root CHANGELOG.md under [0.6.9].

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

Someone is attempting to deploy a commit to the Raphael's projects Team on Vercel.

A member of the Team first needs to authorize it.

@zomux
Copy link
Copy Markdown
Contributor

zomux commented May 4, 2026

Hey @zhoumzh — the Gemini bits from this PR landed via #357 (8d79ed0 + revert 9f5b3f7). For the rest, we'd like to merge the launcher-side improvements but need to ask you to remove the alembic migration changes before we can take this PR. Brief explanation:

Why the alembic changes are blocking

The catchup migration 1c617c141e29_catchup_missing_tables.py (revises 007) was auto-generated against a fresh local DB, so it tries to:

  • op.create_table('files'), create_table('browser_usage'), create_table('browser_tabs')
  • op.add_column('channels', 'title_manually_set'), add_column('channels', 'resume_from')
  • op.add_column('workspace_members', 'description')
  • op.alter_column('browser_contexts', 'shared_with', JSON → JSONB)

Every one of those tables/columns already exists on the production workspace-backend DB (Railway Postgres, restored from Supabase last weekend with alembic_version=007 and full schema). The next deploy after this lands would run alembic upgrade head in entrypoint.sh, hit relation "files" already exists, exit 1, and the workspace-backend container won't boot.

The modifications to migrations 005 and 006 are also problematic — alembic only checks revision IDs, not migration content, so once a DB has applied them, it won't re-apply. Anyone bootstrapping a fresh DB after these land gets a different schema than anyone who set up before, which means schema drift across environments.

What we'd like

Could you split this PR into two:

  1. Keep here (we can merge after a rebase):

    • workspace/Makefiledev-local-backend / dev-local-frontend targets
    • packages/launcher/src/renderer/{index.html,renderer.js} — Settings UI for switching workspace endpoint, smart localhost:3001 browser routing
    • packages/launcher/src/main/main.js — IPC reload-on-workspaceEndpoint-change handler
    • The CHANGELOG + notes file for local-workspace-run
  2. Submit separately as a properly-idempotent PR (or a non-alembic init script):

    • The three alembic files (005, 006, 1c617c141e29)
    • Real fix is either IF NOT EXISTS / conditional op.execute() blocks in a single forward migration, or a separate workspace/backend/scripts/init-local.sql that bypasses alembic for the local-bootstrap case

The local FK type mismatch in 005 is a real bug (we hit it ourselves trying to apply alembic to a fresh DB during the #363 review), so a proper fix is welcome — just needs to not break already-applied DBs.

Once you've got the rebase ready, ping us and we'll pull it in. Thanks for the launcher polish work — the dynamic-endpoint + localhost:3001 routing in particular is going to make local dev a lot less painful.

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.

2 participants