Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
refactor: align workspace_switch description with intent regex + clarify tracker atomicity (#2035)
Adam Eivyfb270e6d0512
diff --git a/server/services/voice/tools/workspace.js b/server/services/voice/tools/workspace.jsindex 04d4cf55b0..ed48059394 100644--- a/server/services/voice/tools/workspace.js+++ b/server/services/voice/tools/workspace.js@@ -15,7 +15,7 @@ export const WORKSPACE_TOOLS = [{name: 'workspace_switch',description:- 'Switch your active project workspace: first save a snapshot of the workspace you are leaving, then restore the named project\'s saved context — its git branch, the shell sessions rooted in its repo, and the tasks scoped to it. Use when the user says "switch workspace to BookLoom", "switch to the finance tracker project", "take me back to PortOS", or "restore my BookLoom context". Restoring only REPORTS which saved shell sessions are still live to re-attach and whether the saved git branch is still checked out — it never checks out branches or spawns shells for the user (that stays a manual action). Name the target project as `workspace`.',+ 'Switch your active project workspace: first save a snapshot of the workspace you are leaving, then restore the named project\'s saved context — its git branch, the shell sessions rooted in its repo, and the tasks scoped to it. Use when the user says "switch workspace to BookLoom", "switch to the finance tracker project", "take me back to the PortOS workspace", or "restore my BookLoom context". Restoring only REPORTS which saved shell sessions are still live to re-attach and whether the saved git branch is still checked out — it never checks out branches or spawns shells for the user (that stays a manual action). Name the target project as `workspace`.',parameters: {type: 'object',properties: {diff --git a/server/services/workspaceContext.js b/server/services/workspaceContext.jsindex 0478d88c10..b31f7b8878 100644--- a/server/services/workspaceContext.js+++ b/server/services/workspaceContext.js@@ -299,6 +299,10 @@ let currentWorkspaceAppId = null;*/export async function snapshotOnRepoSwitch(nextAppId) {const target = nextAppId || PORTOS_APP_ID;+ // The read→update of the tracker is synchronous (no await between them), so+ // concurrent spawns can't tear it — each call atomically captures its own+ // `previous` and advances `current`. Only the subsequent file save awaits,+ // and saveContext already serializes writes through its own single-tail queue.const previous = currentWorkspaceAppId;currentWorkspaceAppId = target;// First switch (no prior workspace) or same repo ⇒ nothing to snapshot.