Skip to content

Add workspace foundation#99

Merged
Fullstop000 merged 13 commits intomainfrom
workspace-foundation
Apr 25, 2026
Merged

Add workspace foundation#99
Fullstop000 merged 13 commits intomainfrom
workspace-foundation

Conversation

@Fullstop000
Copy link
Copy Markdown
Owner

@Fullstop000 Fullstop000 commented Apr 24, 2026

Summary

  • Add first-class workspace tables, migration support, and store APIs for local/cloud workspace records.
  • Create an explicit local workspace during setup with the default name "Chorus Local".
  • Add workspace-scoped channel creation coverage plus setup and invalid workspace mode tests.
  • Add workspace management API/CLI/UI support for create, list, switch, delete, active workspace display, and workspace resource counts.
  • Add the empty-run warning behavior so silent natural completions post a system warning to the triggering channel.

Notes

  • This is the foundation slice for cloud platform workspace architecture, not full route-level workspace scoping yet.
  • Agent names remain globally unique for now because agent_env_vars still references agents(name).
  • chorus workspace create creates a workspace without switching to it; explicit chorus workspace switch <name> changes the active workspace.

Test Plan

  • cargo test
  • cd ui && npm run test
  • cd ui && npx tsc --noEmit
  • cd ui && npm run build
  • browser dogfood of workspace create/list in Settings

Copilot AI review requested due to automatic review settings April 24, 2026 15:45
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces the initial “workspace foundation” layer in the store/CLI, adding workspace persistence and basic APIs, creating a default local workspace during chorus setup, and adding early workspace-scoped channel creation coverage. It also adds a user-visible “empty-run warning” when an agent completes a run without sending a message.

Changes:

  • Add workspace tables + migrations, plus store APIs to create/list/read active workspaces.
  • Update channel storage to support workspace scoping (workspace_id + per-workspace name uniqueness) and add create_channel_in_workspace.
  • Update chorus setup to ensure a local workspace exists (default “Chorus Local”) and add related tests; add empty-run warning behavior + tests.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/store_tests.rs Adds tests for workspace creation/ownership, workspace-scoped channel naming, and unknown workspace mode errors.
src/store/workspaces.rs New workspace data model + Store APIs for creating a local workspace, getting active workspace, and listing workspaces for a human.
src/store/schema.sql Adds workspace tables and introduces workspace_id + new uniqueness strategy for channels/agents/teams.
src/store/mod.rs Exposes the new workspaces module/types from the store.
src/store/migrations.rs Adds workspace foundation migration: new tables, workspace_id columns, and uniqueness indexes.
src/store/channels.rs Adds create_channel_in_workspace for explicit workspace-aware channel creation.
src/cli/setup.rs Ensures an explicit local workspace exists during setup; adds tests and displays workspace info.
src/agent/event_forwarder.rs Posts a system warning if a run completes “naturally” without invoking send_message; adds tests.
docs/CLI.md Documents setup creating a local workspace and the non-interactive default name.
VERSION Bumps version to 0.0.2.0.
CHANGELOG.md Adds release notes entry for empty-run warnings (fixes #97).

Comment thread CHANGELOG.md
Comment thread src/store/workspaces.rs Outdated
Comment thread src/agent/event_forwarder.rs Outdated
Comment thread src/store/schema.sql
Comment thread src/store/schema.sql Outdated
Comment thread src/store/migrations.rs
Copy link
Copy Markdown
Owner Author

@Fullstop000 Fullstop000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing position

Comment thread src/server/handlers/mod.rs
Copy link
Copy Markdown
Owner Author

@Fullstop000 Fullstop000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Solid foundation PR. The workspace data model is clean, migrations are safe (legacy indices for NULL workspace_id rows), and the resource-isolation tests give confidence. I noted a few concerns around async runtime ergonomics and request-handler I/O that are worth addressing before merge.

Approve with suggestions — nothing blocking, but I'd recommend the RwLock and local_human changes.

See inline comments for details.

Comment thread src/server/handlers/mod.rs
Comment thread src/server/handlers/mod.rs
Comment thread src/server/handlers/workspaces.rs
Comment thread src/server/handlers/workspaces.rs Outdated
Comment thread src/server/handlers/workspaces.rs Outdated
@Fullstop000 Fullstop000 merged commit 97fb7c7 into main Apr 25, 2026
3 checks passed
@Fullstop000 Fullstop000 deleted the workspace-foundation branch April 25, 2026 12:30
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