Skip to content

feat: Space layer above Project + RunContext + Single Agent CDP#1655

Merged
4pmtong merged 18 commits into
testfrom
feat/new-space-layer
May 29, 2026
Merged

feat: Space layer above Project + RunContext + Single Agent CDP#1655
4pmtong merged 18 commits into
testfrom
feat/new-space-layer

Conversation

@4pmtong
Copy link
Copy Markdown
Collaborator

@4pmtong 4pmtong commented May 26, 2026

Related Issue

#1651

Description

Introduces the Space layer above Project: a Space (folder-backed or blank)
holds Projects; a Project is one conversation; a Run is one execution.

Three load-bearing pieces ship together:

  1. Space -> Project -> Run data model — server tables + migration + Brain
    workspace state + frontend stores + UI.
  2. RunContext per-Run isolation replaces ad-hoc os.environ writes in
    chat_controller and toolkits; concurrent chats no longer overwrite each
    other's working dirs, API keys, browser ports, or CAMEL log paths.
  3. Single Agent gains a CDP browser (shared pool with Browser Agent +
    try/finally release).

Plus: durable cross-restart project_context for follow-up turns, 4-layer
Project display-name backfill, camel_logs hidden from agent file UI, Brain
auth scaffold (NoneAuth default — local desktop Brain only),
file_save_path keyed by canonical user_id with project-base-level legacy
email fallback.

Deployment — required before merging

  • Run preflight (server/scripts/space_migration_preflight.py) to catch
    cross-user project_id collisions before the migration silently rewrites
    them.
  • Schedule a maintenance window: Postgres-only migration, in-tx UPDATE
    on chat_history holds row locks for the duration.
  • Rollback = pg_dump snapshot restore, not alembic downgrade — the
    downgrade drops new shape but does not revert in-place data backfills.
  • Single worker / single replica — per-Space write locks in
    apply_service.py + space_overlay_client.py are process-local.
  • workspace_controller is gated by manifest.get("deployment") == "local" — do not enable on any cloud / multi-tenant Brain until a real
    IAuthProvider lands.
  • ~/eigent/{email_sanitized}/ legacy artifacts stay readable via fallback;
    old directories are not auto-migrated.

Testing Evidence (REQUIRED)

  • I have included human-verified testing evidence in this PR.
  • This PR includes frontend/UI changes, and I attached screenshot(s) or screen recording(s).
  • No frontend/UI changes in this PR.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Contribution Guidelines Acknowledgement

@4pmtong 4pmtong merged commit cf3cb8c into test May 29, 2026
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