From 469e80131923f0ade2069119ace32cc1fdb2a260 Mon Sep 17 00:00:00 2001 From: kicer Date: Wed, 11 Nov 2026 17:11:51 +0800 Subject: [PATCH] =?UTF-8?q?chore(local):=20=E6=8F=90=E7=A4=BA=E8=AF=8D?= =?UTF-8?q?=E5=8F=AA=E7=BB=99=E5=AE=89=E8=A3=85=E4=BD=8D=E7=BD=AE=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=86=99=E3=80=8C=E5=8F=AA=E5=9C=A8=E7=BC=BA=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E6=97=B6=E6=89=8D=E9=97=AE=E3=80=8D=E8=BF=99=E7=A7=8D?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 「安装前先问用户」是允许的,没必要用条件句把它收窄成「仅当需要密码时」。 env-local 现在只说一句:需要装就装,Python 包装进 $AGENT_SKILLS_DEPS。 知不知会用户交给模型按场合判断。docs/local-mode 4.13 同步。 --- app/server/templates/env-local.txt | 5 ++--- docs/local-mode.md | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/server/templates/env-local.txt b/app/server/templates/env-local.txt index b88e5a3..69e8a74 100644 --- a/app/server/templates/env-local.txt +++ b/app/server/templates/env-local.txt @@ -1,6 +1,5 @@ - You run on the user's own machine with their permissions, not a sandbox; other conversations share it and `/tmp` is the system temp dir. Work inside the working directory; treat everything outside it as the user's. -- `python3` may be missing. Install whatever a task needs and keep going — Python - packages go into `$AGENT_SKILLS_DEPS`; only stop to ask if an install needs the - user's password. +- `python3` may be missing. Install what a task needs; Python packages go into + `$AGENT_SKILLS_DEPS`. diff --git a/docs/local-mode.md b/docs/local-mode.md index f64c4ba..1bfccf5 100644 --- a/docs/local-mode.md +++ b/docs/local-mode.md @@ -268,8 +268,8 @@ health 只作为「端口上有服务但不是本启动器拉起的」兜底提 PEP 668 拦截明确豁免(`pip/_internal/commands/install.py`),所以这条路在 Homebrew 那种 externally-managed 解释器上也走得通——但这话不写进提示词,交给模型自己判断。 - 缺 `python3` 本体时也放给模型自己处理:本地形态是「用户自己的机器 + 用户自己的 agent」, - 目标是把事做成,而不是把它当生产环境保护。提示词只说「需要什么就装、装完继续;只有需要 - 用户密码时才停下来问」——`sudo` 本来就会卡在密码上,不必再用规则去禁。 + 目标是把事做成,而不是把它当生产环境保护。提示词只告诉它**装到哪**(Python 包进 + `$AGENT_SKILLS_DEPS`),不写条件也不写禁令——要不要先知会用户,交给模型按场合自己判断。 - 技能自己的 `requirements.txt` 一律**不写版本号**:服务端 init 用 `pip install --no-index --dry-run` 探测,pin 到与镜像不同的版本会让探测失败 → 真的往 `skills/deps` 装一份旧的,而 `PYTHONPATH` 优先于系统 site-packages,等于反向遮蔽镜像包。