Files
agent/app/config.example.yml
T
kicer 7f8cf64e88 会话阶段状态机advising/executing(单会话单问题:先聊清再干活):新建会话与「清空」落advising——resolveProfileName两档化(phase=advising强制命中内置advising组合,否则随模型配置profile,tools_allow只留read_file/fetch/write_file、不带skill故模板无技能清单段,配advising-system.txt:问答判意图引导澄清、每轮至多1-2问防过度追问);唯一出口是任务书正门——runLoopInner工具批跑完后,advising回合内write_file/edit_file成功落任务目录根task.md(argsHitTaskBrief,上传同名与terminal间接创建不算;批量末尾统一切,防父assistant先存档后落库回执成孤儿行被上游拒收)即enterExecuting:全史标archived+插type=task_brief磁盘快照行作执行阶段唯一上下文起点+phase翻转与SSE phase广播,下一迭代重读历史重解profile天然切默认组合、同回合开工(幂等:执行中再改task.md只是普通编辑);回头路只有清空(archiveTaskBrief把旧task.md mv进.task-history/task-<ts>.md防污染新规划,点目录沿用.imgcache隐式约定);压缩对phase中性(压完回原模式,task_brief不豁免存档,漂移可控因压缩本就用户主导);定时投递前强制executing(无人值守不能被顾问话术卡住);db迁移存量phase回填executing零打扰、sessions.profile列废弃不读写;运行期手动切profile全拆(消息级参数/bind的profile分支/setSessionProfile与hasModelProfile/status的model_profiles名单/bind弹窗模式区),头部徽标机位复用为阶段徽标(仅advising显灯泡,SSE phase驱动,转执行toast反馈)
2026-09-25 11:54:20 +08:00

78 lines
4.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# config.example.yml — 配置模板:与 server/config.js 的 DEFAULTS 一一对应。
# 复制为 config.yml 即可启动;platforms 为空则无模型可用,可在前端设置页添加后重启。
# 模型平台池:每平台 {name, url, type?, models:[{id, ...}], keys:[{api_key, concurrency?}]}。
platforms: []
# 全局工具黑名单:profile 未配 tools_deny 时继承它;allow 先、deny 后叠加(deny 赢,与 mcp_servers 同构)。
# 写数组即整体覆盖默认值,写 [] 即清空。默认屏蔽元工具 lab。
tools_deny: [lab]
# 模型 profile:prompt + tools 名单组合,模型用 profile: <名> 引用(不配 = 全量)。
# 内置 advising 不靠引用:会话处于 advising 阶段(顾问澄清需求/规划)时强制命中,见 server/engine.js resolveProfileName。
model_profiles:
advising: # 顾问阶段:只留问答/调研/写任务书工具,配专属提示词
tools_allow: [read_file, fetch, write_file]
system_prompt_file: advising-system.txt
lab: # 统一入口自测:tools 只有 lab,其余能力经 lab(help) 现场发现
tools_allow: [lab]
tools_deny: [] # 必须显式清空全局黑名单,否则 lab 自己也被 deny → 零工具
system_prompt_file: lab-system.txt # 相对 server/templates/(也接受绝对路径)
zero: # 纯文本对话:一个工具都不发
tools_allow: []
system_prompt_file: zero-system.txt
port: 8090 # 服务监听端口
workspace_root: "/workspace/tasks" # 任务工作区根目录,AI 文件操作限制在此
data_root: "/workspace/data" # 数据根目录:SQLite 与 prompt dump
db_path: "" # 留空取 data_root/.agent.db
log_level: "info" # debug < info < warn < error < none
executor: # 独立命令执行服务;两侧需同路径挂载 tasks/skills
url: "" # 非空走远端执行;留空读 env EXECUTOR_URL 或本地 spawn
token: "" # 与 executor 侧同值;留空读 env EXECUTOR_TOKEN
terminal:
default_timeout_ms: 30000 # 命令默认超时(ms)
max_output_chars: 10000 # 回传模型的最大输出字符数
fetch:
timeout_ms: 30000 # 抓取总超时(ms),覆盖响应头到 body 读完
max_bytes: 1048576 # 单次响应最多抓多少字节,超限即断开
agent:
temperature: 1.0 # 采样温度
max_tool_iterations: 100 # 单轮最大迭代数(含工具调用)
max_retries: 2 # 上游失败重试次数
language: "Simplified Chinese" # 强制回复语言;留空不限
auto_compress_tokens: 60000 # In token 超此值弹「自动压缩」提议;0=关
upload:
image_compress_threshold_kb: 1536 # 大图压缩提示阈值(KB)
image_max_dim: 2000 # 压缩后长边上限(px)
image_quality: 0.85 # JPEG 质量
confirm_size_mb: 10 # 任意文件二次确认阈值(MB)
skills:
skills_root: "" # 留空取 workspace_root 同级 skills 目录
timeout_ms: 120000 # 单个技能执行超时(ms)
model_hold:
idle_release_ms: 180000 # 无人观看超时释放(ms)
active_max_ms: 1800000 # 有人观看最长保持(ms)
sweep_ms: 10000 # 租约巡检间隔(ms)
auth: # users 留空 = 不启用登录认证
secret: "" # 登录态签名密钥;留空则每次重启随机(需重新登录)
ttl_ms: 2592000000 # 登录态有效期(ms,默认 30 天)
users:
- user: admin # 默认账号
password: "admin" # 默认密码,请务必修改
# 外部 MCP 服务列表:每项 {name?, url, headers?, enable?(默认 true), timeout_ms?, tools_allow?, tools_deny?}。
mcp_servers: []
public_link:
base_url: "" # 留空关闭 mint_public_link;填本服务对外地址
ttl_ms: 1800000 # 链接有效期(ms)