Skip to content

Self-improving AI Employees for everyone

fix: workspace guardrails, cross-platform workflow naming, os.getcwd removal

trohitg06f1db6914f3
diff --git a/server/services/claude_code_service.py b/server/services/claude_code_service.py
index 183404f9..a142a102 100644
--- a/server/services/claude_code_service.py
+++ b/server/services/claude_code_service.py
@@ -58,7 +58,11 @@ class ClaudeCodeService:
if system_prompt:
cmd += ["--append-system-prompt", system_prompt]
- work_dir = cwd or os.getcwd()
+ if not cwd:
+ from core.config import Settings
+ cwd = os.path.join(Settings().workspace_base_dir, 'default')
+ os.makedirs(cwd, exist_ok=True)
+ work_dir = cwd
proc = await asyncio.create_subprocess_exec(
*cmd,
diff --git a/server/services/process_service.py b/server/services/process_service.py
index f3291312..bf929bf2 100644
--- a/server/services/process_service.py
+++ b/server/services/process_service.py
@@ -103,7 +103,20 @@ class ProcessService:
argv = shlex.split(command)
env = {**os.environ, "PYTHONUNBUFFERED": "1"}
- cwd = working_directory or os.getcwd()
+ from core.config import Settings
+ workspace_base = Path(Settings().workspace_base_dir).resolve()
+
+ if not working_directory:
+ working_directory = str(workspace_base / 'default')
+ os.makedirs(working_directory, exist_ok=True)
+ cwd = working_directory
+
+ # Guardrail: cwd must resolve inside workspace base
+ if not Path(cwd).resolve().is_relative_to(workspace_base):
+ return {
+ "success": False,
+ "error": f"Working directory must be inside workspace ({workspace_base}).",
+ }
# Create log directory inside the workflow workspace
# Layout: {workspace}/.processes/{name}/stdout.log, stderr.log
diff --git a/workflows/AI Employee[Experimental].json b/workflows/ai-employee-experimental.json
similarity index 99%
rename from workflows/AI Employee[Experimental].json
rename to workflows/ai-employee-experimental.json
index a8c14c0b..ca47d543 100644
--- a/workflows/AI Employee[Experimental].json
+++ b/workflows/ai-employee-experimental.json
@@ -1,6 +1,6 @@
{
- "id": "example_workflow-1772437472641-wdn3sj4us",
- "name": "AI Employee[Experimental]",
+ "id": "ai-employee-experimental",
+ "name": "AI Employee (Experimental)",
"nodes": [
{
"id": "orchestrator_agent-1772283239381",
diff --git a/workflows/Zeenie Agent.json b/workflows/zeenie-agent.json
similarity index 99%
rename from workflows/Zeenie Agent.json
rename to workflows/zeenie-agent.json
index 4e2d0714..b69def49 100644
--- a/workflows/Zeenie Agent.json
+++ b/workflows/zeenie-agent.json
@@ -1,5 +1,5 @@
{
- "id": "example_workflow-1770568399727-b5zkjpuda",
+ "id": "zeenie-agent",
"name": "Zeenie Agent",
"nodes": [
{
diff --git a/workflows/Zeenie Assistant.json b/workflows/zeenie-assistant.json
similarity index 99%
rename from workflows/Zeenie Assistant.json
rename to workflows/zeenie-assistant.json
index 5e1ea242..95a83af3 100644
--- a/workflows/Zeenie Assistant.json
+++ b/workflows/zeenie-assistant.json
@@ -1,5 +1,5 @@
{
- "id": "example_workflow-1772151325023-i7zkjbt04",
+ "id": "zeenie-assistant",
"name": "Zeenie Assistant",
"nodes": [
{