Files
nexus/wiki/concepts/Layered-Configuration.md
2026-04-23 04:02:48 +08:00

27 lines
1.2 KiB
Markdown
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.
---
title: "Layered Configuration"
type: concept
last_updated: 2026-04-10
---
## Definition
Layered Configuration分层配置指系统配置存在多个层级不同层级的配置有不同的优先级和作用范围。修改某一层级的配置无法影响其他层级的行为。
## OpenClaw 配置层级
1. **Global Config** (`openclaw.json`): 全局 compaction 配置,影响所有 Agent
2. **Agent/Channel Specific Config**: 针对特定 Telegram Channel 或 Agent 的模型映射规则
3. **环境变量**: 启动脚本里的 `MODEL_DEFAULT` 可能覆盖配置文件
## Debugging Implication
> **两层配置要分清:全局 compaction 配置和 agent 模型配置是两码事。改全局不行,就得往 agent 级别去找。**
当问题在全局层面无法解决时,需要检查 Agent 级别的路由规则和模型绑定配置。
## Related
- [[Agent-Routing-Rules]]: Agent 级别配置的具体形式
- [[Compaction]]: 全局 compaction 配置的作用范围
- [[Error-Surface-vs-Root-Cause]]: 分层配置是"错误表象 ≠ 根本原因"的常见原因
## Sources
- [[养虾日记4-一次「context-limit-exceeded」错误排查-我以为是小问题-结果踩了大坑]]