diff --git a/backend/apps/agents/manager/prompt/prompt_context.py b/backend/apps/agents/manager/prompt/prompt_context.py index 73a0868d..9dadcde2 100644 --- a/backend/apps/agents/manager/prompt/prompt_context.py +++ b/backend/apps/agents/manager/prompt/prompt_context.py @@ -435,7 +435,12 @@ AGENT_IDENTITY = ( f"when the task needs it (real explanation, code, steps), then stay clean and structured. " f"Don't open with \"Certainly\" or \"Great question\". Hard rule: never put a \"-\" dash in " f"your prose. No em dashes, no en dashes, no hyphen used as a dash. Use commas, periods, " - f"colons, or parentheses instead." + f"colons, or parentheses instead.\n\n" + f"# Dependencies and tooling\n" + f"Install what you need yourself (pip into a venv you make, npm install) and only mention it " + f"if it fails; never hand the user a raw install command to run. If git or another dev tool " + f"is missing, work without it in the plain directory; suggest installing it only when the " + f"task itself is about that tool, in one plain sentence with the reason." ) diff --git a/backend/apps/agents/manager/run/RunOptions.py b/backend/apps/agents/manager/run/RunOptions.py index 3d17e79c..70cc28d3 100644 --- a/backend/apps/agents/manager/run/RunOptions.py +++ b/backend/apps/agents/manager/run/RunOptions.py @@ -205,6 +205,11 @@ class RunOptions(AgentManagerProtocol): ) # The CLI's own auto-memory keys its directory on cwd, and every chat has its own workspace cwd, so it silently files memories into per-chat buckets no other chat reads; MemoryRead/MemoryWrite on the shared store is the one memory surface (ENG-222). options_kwargs.setdefault("env", {})["CLAUDE_CODE_DISABLE_AUTO_MEMORY"] = "1" + # Packaged builds put the app bundle's site-packages on PYTHONPATH, which shadows any venv an agent makes: pip reports success while installing nothing (ENG-347). Keep only the debugger injection dir. + p_pp = os.environ.get("PYTHONPATH", "") + if p_pp: + p_kept = [e for e in p_pp.split(os.pathsep) if e and "debugger" in os.path.basename(e.rstrip("/\\"))] + options_kwargs["env"]["PYTHONPATH"] = os.pathsep.join(p_kept) logger.info(f"[SPAWN-PHASE] provider-env done session={session_id[:8]} t={time.monotonic():.3f}") if mcp_servers: options_kwargs["mcp_servers"] = mcp_servers diff --git a/backend/apps/outputs/app_builder_skill.md b/backend/apps/outputs/app_builder_skill.md index 18d7d442..d721ccf9 100644 --- a/backend/apps/outputs/app_builder_skill.md +++ b/backend/apps/outputs/app_builder_skill.md @@ -272,6 +272,7 @@ and flips `BACKEND_PORT` in both `.env` and `.env.example`. Then run - Use Flask, Django, or any framework other than the FastAPI scaffold the script gives you. - Install your own venv or `pip install` manually. +- Ask the user to run pip or install anything. Python deps go in `backend/pyproject.toml`; the framework's restart installs them. Users never run install commands. - Edit `backend/run.sh` or the SubApp framework. **Persist anything the user comes back to. Your process is disposable.**