配置

项目配置(downcity.json)

downcity.json 中用户最常用字段与注意事项

项目配置(downcity.json)

downcity.json 是项目级运行入口,常用字段如下:

{
  "name": "my-agent",
  "execution": {
    "type": "api",
    "modelId": "quality"
  },
  "start": {
    "host": "127.0.0.1",
    "port": 5314
  }
}

注意事项

  1. 项目现在必须声明 execution,执行模式固定为 api
  2. execution.modelId 必须存在于已连接的 City AIService 中。
  3. start.host/start.port 会影响 CLI 的默认路由目标。
  4. 项目层统一在 downcity.json 中维护 plugins 与执行相关配置。
  5. 本地 shell / CLI 命令默认强制运行在 sandbox 中,顶层 sandbox 只用于调整边界参数。

执行模式

如果你希望项目使用 City AIService 模型:

{
  "execution": {
    "type": "api",
    "modelId": "default"
  }
}

Shell Sandbox

当前版本里,shell / CLI 命令默认强制运行在 sandbox 中。项目层 sandbox 只用于调整边界参数:

{
  "sandbox": {
    "networkMode": "off",
    "writablePaths": [".", ".downcity"],
    "envAllowlist": ["PATH", "LANG", "TERM", "SHELL"]
  }
}

当前版本的行为:

  • 作用于 shell plugin 与 kind=script 的 task 执行链
  • 当前优先支持 macOS,本地 backend 使用系统自带 sandbox-exec
  • 不支持关闭 sandbox,也不会回退到宿主机普通子进程执行
  • 未挂入 sandbox 的宿主路径默认不可见
  • writablePaths 只允许写项目根目录内的路径
  • 默认网络是放开的;未显式配置时等价于 networkMode="full"
  • networkMode="off" 时禁止联网
  • networkMode="restricted" 当前先按放开网络处理
  • networkMode="full" 允许 shell 打开网络访问

常用命令

town config get
town config get execution
town config set start.port 3100

相关文档