参考与 FAQ / 配置项
配置项
灵犀指内核的配置文件为 lxz.config.json(JSON 格式),内核启动时读取。以下按模块列出全部配置项的键、说明与默认值。
!
修改须知:server.auth_token 由内核自动生成,请勿手工修改或提交到版本库;privacy.exclude_files 与 safety.blocked_paths 涉及代码与凭据安全,清空前请确认后果。
| 键 | 说明 | 默认值 |
|---|
agent.auto_execute | Agent 自动执行,无需逐步确认 | false |
agent.confirmation_timeout_sec | 危险操作确认超时(秒) | 300 |
agent.max_context_tokens | Agent 上下文上限(tokens) | 128000 |
agent.max_iterations | 单任务最大迭代次数(硬上限) | 50 |
agent.parallel_max_workers | RUSH 并行 Coder 智能体上限 | 4 |
agent.subagent_max_iterations | 子智能体最大迭代次数 | 20 |
llm.max_tokens | 单次请求最大输出 tokens | 4096 |
llm.temperature | 采样温度 | 0.7 |
llm.timeout_sec | 请求超时(秒) | 60 |
llm.retry_count / llm.retry_delay_ms | 失败重试次数 / 间隔(毫秒) | 3 / 1000 |
llm.stream_chunk_size | 流式输出分块大小 | 64 |
model_config.source | 模型配置来源 | "go" |
model_config.server_url | 模型配置服务地址 | http://localhost:9527/api/v1 |
model_config.cache_ttl_seconds | 模型配置缓存 TTL(秒) | 300 |
model_config.offline_fallback_enabled | 离线兜底开关 | false |
✦
RUSH 相关:迭代行为由 agent.max_iterations(硬上限)与内置收敛阈值 0.95 共同决定——同一错误连续出现 3 次或达到上限即终止当前路线并重规划;并行度由 agent.parallel_max_workers 控制。详见 RUSH 指南。
| 键 | 说明 | 默认值 |
|---|
cache.enabled | 三层缓存总开关 | true |
cache.l1_capacity | L1 精确缓存容量(条) | 256 |
cache.l2_similarity_threshold | L2 相似缓存命中阈值 | 0.92 |
cache.l3_max_templates | L3 模板缓存上限 | 100 |
cache.preheat_on_startup / cache.preheat_top_files | 启动预热开关 / 预热文件数 | true / 20 |
cache.ttl_seconds | 缓存过期时间(秒) | 3600 |
memory.enabled | 持久化记忆开关 | true |
memory.auto_learn | 自动学习项目模式 | true |
memory.db_path | 记忆数据库路径 | .lxz/memory.db |
memory.max_entries | 记忆条目上限 | 10000 |
memory.context_assembly_max_tokens | 记忆注入上下文上限 | 4000 |
memory.semantic_index_enabled / memory.wal_mode | 语义检索索引 / SQLite WAL 模式 | true / true |
| 键 | 说明 | 默认值 |
|---|
ide.theme | 主题(dark / light) | "dark" |
ide.layout | 界面布局 | "trae_cn" |
ide.chat_position / ide.sidebar_position | AI 对话 / 侧边栏位置 | "right_panel" / "right" |
ide.model_selector_style | 模型选择器样式 | "trae_cup" |
ide.completion_debounce_ms | 补全触发防抖(毫秒) | 150 |
ide.inline_edit_context_lines | 内联编辑携带的上下文行数 | 5 |
ide.diagnostic_refresh_on_save | 保存时刷新诊断 | true |
i18n.language / i18n.fallback_language | 界面语言 / 回退语言 | "zh" / "en" |
| 键 | 说明 | 默认值 |
|---|
lsp.enabled | LSP 总开关 | true |
lsp.mode | 运行模式(内置优先、失败回退) | "builtin_with_fallback" |
lsp.builtin_servers_dir | 内置语言服务目录 | "lsp-servers" |
lsp.max_concurrent_processes / lsp.max_per_workspace | 全局并发进程上限 / 单工作区上限 | 10 / 5 |
lsp.cpu_limit_percent | CPU 占用上限(%) | 50 |
lsp.memory_limit_mb | 内存上限(MB) | 1024 |
lsp.idle_timeout_minutes | 空闲回收时间(分钟) | 10 |
lsp.initialize_timeout_ms | 初始化超时(毫秒) | 30000 |
lsp.fallback_timeout_ms | 回退超时(毫秒) | 2000 |
lsp.disabled_languages | 禁用 LSP 的语言列表 | [] |
lsp.disabled_for_remote | 远程工作区禁用 | true |
lsp.language_overrides | 按语言覆盖服务配置 | {} |
lsp.sandbox_mode | 沙箱模式运行语言服务 | false |
| 键 | 说明 | 默认值 |
|---|
safety.enabled | 安全防护总开关 | true |
safety.snapshot_before_edit | 编辑前自动快照 | true |
safety.auto_recover_on_failure | 失败自动恢复 | true |
safety.dangerous_commands_require_confirmation | 危险命令需确认 | true |
safety.max_file_size_kb | 单文件处理上限(KB) | 512 |
safety.blocked_paths | 禁止 AI 读写的路径 | node_modules、.git、target、__pycache__ |
privacy.mode | 隐私模式 | "standard" |
privacy.exclude_files | 不上传的敏感文件 | .env、.env.local、credentials.json、secrets.yaml |
privacy.redact_patterns | 传输前脱敏的正则(密码、Key、Bearer、卡号、邮箱) | 内置 5 条 |
| 键 | 说明 | 默认值 |
|---|
sandbox.enabled | 本地沙箱开关 | false |
sandbox.type | 沙箱类型 | "process" |
sandbox.docker_image | Docker 沙箱镜像 | "lingxizhi/sandbox:latest" |
sandbox.max_cpu_percent / sandbox.max_memory_mb | CPU(%)/ 内存(MB)上限 | 80 / 512 |
sandbox.network_enabled | 沙箱内联网 | false |
sandbox.timeout_sec | 执行超时(秒) | 300 |
cost.budget_usd_daily / cost.budget_usd_monthly | 日 / 月成本预算(USD,BYOK 自管) | 10.0 / 200.0 |
cost.track_by_model | 按模型分别统计 | true |
cost.warning_threshold_percent | 预算告警阈值(%) | 80 |
benchmark.categories | 基准测试类别 | filesystem、cache、memory |
benchmark.output_dir | 基准结果输出目录 | .lxz/benchmarks |
benchmark.run_on_startup | 启动时自动跑基准 | false |
| 键 | 说明 | 默认值 |
|---|
integrations.git_platform | 默认 Git 平台 | "gitee" |
integrations.gitee_access_token / github_access_token / gitlab_access_token | 各平台访问令牌 | "" |
integrations.notifications | 通知渠道配置 | [] |
plugins.enabled | 插件系统开关 | true |
plugins.auto_update | 插件自动更新 | false |
plugins.marketplace_url | 插件市场地址 | https://marketplace.lingxizhi.dev/api/v1 |
plugins.search_dirs | 插件搜索目录 | .lxz/extensions |
hooks.enabled | 钩子开关 | true |
hooks.pre_edit / post_edit | 编辑前 / 后钩子命令 | [] |
hooks.pre_commit / post_commit | 提交前 / 后钩子命令 | [] |
hooks.on_error | 出错时钩子命令 | [] |
| 键 | 说明 | 默认值 |
|---|
server.host | 监听地址(仅本机回环) | 127.0.0.1 |
server.port | 监听端口(被占用时自动递增,最多 10 个) | 3721 |
server.auth_token | 本地调用令牌(自动生成) | 启动时生成 |
server.cors_origins | 允许的跨域来源 | http://localhost:*、vscode-webview://* |
server.max_body_size_mb | 请求体上限(MB) | 50 |
server.request_timeout_sec | 请求超时(秒) | 120 |
本文对你有帮助吗?