mirror of
https://gitee.com/mateos/mateclaw.git
synced 2026-09-13 03:13:41 +08:00
545 lines
28 KiB
YAML
545 lines
28 KiB
YAML
server:
|
||
port: 18088
|
||
servlet:
|
||
context-path: /
|
||
|
||
spring:
|
||
application:
|
||
name: mateclaw-server
|
||
messages:
|
||
basename: messages
|
||
encoding: UTF-8
|
||
servlet:
|
||
multipart:
|
||
max-file-size: 100MB
|
||
max-request-size: 200MB
|
||
threads:
|
||
virtual:
|
||
enabled: true
|
||
profiles:
|
||
active: dev
|
||
|
||
# 数据源(默认 H2,生产切换为 mysql 或 kingbase profile)
|
||
datasource:
|
||
url: jdbc:h2:file:./data/mateclaw;MODE=MySQL;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
|
||
driver-class-name: org.h2.Driver
|
||
username: sa
|
||
password:
|
||
# Issue #50: explicit Hikari sizing. Default of 10 was being exhausted
|
||
# by O(100) cron jobs firing on minute boundaries (each run holds 3-4
|
||
# connections sequentially) plus ChannelHealthMonitor's per-minute scan.
|
||
# 30 leaves headroom for HTTP / SSE / channel adapters even with the
|
||
# cron concurrency limiter (CronJobService.MAX_CONCURRENT_CRON_RUNS=8)
|
||
# at full saturation.
|
||
hikari:
|
||
maximum-pool-size: 30
|
||
minimum-idle: 5
|
||
connection-timeout: 30000
|
||
idle-timeout: 600000
|
||
max-lifetime: 1800000
|
||
leak-detection-threshold: 60000
|
||
|
||
# SQL 初始化由 DatabaseBootstrapRunner 接管,关闭 Spring 自动执行
|
||
sql:
|
||
init:
|
||
mode: never
|
||
|
||
# Flyway 数据库版本迁移
|
||
flyway:
|
||
enabled: true
|
||
baseline-on-migrate: true
|
||
baseline-version: "1"
|
||
locations:
|
||
- classpath:db/migration/h2
|
||
validate-on-migrate: true
|
||
clean-disabled: true
|
||
# Disable Flyway's built-in ${...} placeholder substitution. Some migrations
|
||
# (e.g. V85 ckjia MCP seed) intentionally store ${ENV_VAR} literals so that
|
||
# mateclaw's runtime header parser (McpClientManager.parseHeaders) can
|
||
# expand them at request time. Flyway would otherwise try to resolve those
|
||
# tokens at migration time and fail with "No value provided for placeholder".
|
||
# Safe to disable globally because no migration in this project relies on
|
||
# Flyway-side ${...} substitution.
|
||
placeholder-replacement: false
|
||
|
||
h2:
|
||
console:
|
||
enabled: ${H2_CONSOLE_ENABLED:false}
|
||
path: /h2-console
|
||
|
||
# Spring AI Alibaba (DashScope) — Spring AI Alibaba 1.1.x configuration path.
|
||
#
|
||
# The api-key here is only consumed by Spring AI Alibaba's auto-configured beans
|
||
# as a *fallback*. The real source of truth for every provider/key/model is the
|
||
# admin UI ("Settings → Models", persisted in mate_model_provider /
|
||
# mate_model_config); AgentDashScopeChatModelBuilder resolves the key per-request
|
||
# from the provider row first, only falling back to this property when the row
|
||
# is incomplete. The placeholder default keeps DashScopeChatAutoConfiguration
|
||
# happy at startup when no env var is set (Docker / fresh install) — leave it
|
||
# alone unless you know what you're doing.
|
||
ai:
|
||
dashscope:
|
||
api-key: ${DASHSCOPE_API_KEY:configure-in-admin-ui}
|
||
chat:
|
||
options:
|
||
model: qwen-max
|
||
temperature: 0.7
|
||
max-tokens: 4096
|
||
# Spring AI 1.1.x 会话记忆配置(使用内嵌 H2 时无需额外配置)
|
||
chat:
|
||
observations:
|
||
log-prompt: false
|
||
log-completion: false
|
||
memory:
|
||
repository:
|
||
jdbc:
|
||
initialize-schema: embedded
|
||
# Spring AI Retry 配置:429/503/529 归为可重试(TransientAiException),启用指数退避
|
||
# RFC-012 M1:max-attempts 从 5 调到 2,避免与 wiki 层 callLlmWithResilientRetry 的 5×N 嵌套放大;
|
||
# 真正的重试主控权交给业务层(wiki / agent),Spring AI 仅负责"一次性瞬时抖动"的快速重试
|
||
retry:
|
||
max-attempts: 2
|
||
on-http-codes: 429, 503, 529
|
||
backoff:
|
||
initial-interval: 3000
|
||
multiplier: 3
|
||
max-interval: 60000
|
||
# 禁用 Spring AI MCP Client 自动配置(由 McpClientManager 自行管理生命周期)
|
||
mcp:
|
||
client:
|
||
enabled: false
|
||
|
||
# MyBatis Plus
|
||
mybatis-plus:
|
||
configuration:
|
||
map-underscore-to-camel-case: true
|
||
# SQL parameter values can contain prompts/model thinking. Keep them out of
|
||
# logs by default; operators may explicitly opt in for short-lived diagnosis.
|
||
log-impl: ${MATECLAW_MYBATIS_LOG_IMPL:org.apache.ibatis.logging.nologging.NoLoggingImpl}
|
||
|
||
# SpringDoc OpenAPI
|
||
# 注意:/swagger-ui*、/v3/api-docs*、/webjars/** 落在 SecurityConfig 的
|
||
# .anyRequest().permitAll(),即 Swagger UI 当前公开可访问。如生产需要收口,
|
||
# 在 SecurityConfig 加显式规则(不要在此处配)。
|
||
springdoc:
|
||
api-docs:
|
||
path: /v3/api-docs
|
||
swagger-ui:
|
||
path: /swagger-ui.html
|
||
# 把单个嵌套 query 参数对象(如分页 wrapper)拍平成独立字段,减少 schema 噪音
|
||
default-flat-param-object: true
|
||
|
||
# MateClaw 自定义配置
|
||
mateclaw:
|
||
execution-evidence:
|
||
# Observe receipts only. Enforcement requires managed verification scopes and is not available yet.
|
||
mode: observe
|
||
retention-days: 90
|
||
max-summary-bytes: 2048
|
||
max-observations: 32
|
||
default-list-limit: 20
|
||
max-list-limit: 100
|
||
cleanup-interval-ms: 60000
|
||
cleanup-max-batches: 10
|
||
a2a:
|
||
enabled: ${MATECLAW_A2A_ENABLED:false}
|
||
# Public base URL for Agent Cards. Production deployments should set this
|
||
# explicitly so peers do not depend on proxy-derived request headers.
|
||
base-url: ${MATECLAW_A2A_BASE_URL:}
|
||
call-timeout-ms: ${MATECLAW_A2A_CALL_TIMEOUT_MS:120000}
|
||
max-tasks: ${MATECLAW_A2A_MAX_TASKS:1000}
|
||
task-ttl-seconds: ${MATECLAW_A2A_TASK_TTL_SECONDS:3600}
|
||
max-response-bytes: ${MATECLAW_A2A_MAX_RESPONSE_BYTES:1048576}
|
||
outbound-timeout-ms: ${MATECLAW_A2A_OUTBOUND_TIMEOUT_MS:120000}
|
||
allow-private-outbound: ${MATECLAW_A2A_ALLOW_PRIVATE_OUTBOUND:false}
|
||
sweep-interval-ms: ${MATECLAW_A2A_SWEEP_INTERVAL_MS:60000}
|
||
|
||
# DeepSeek Harness runtime. The executable and Cordis composition are kept
|
||
# outside the Spring classpath and can be supplied by environment variables.
|
||
agent:
|
||
runtime:
|
||
dsh:
|
||
command: ${DSH_JSONRPC_AGENT:}
|
||
cordis-config: ${DSH_CORDIS_CONFIG:}
|
||
working-directory: ${DSH_CWD:}
|
||
base-url: ${DEEPSEEK_BASE_URL:}
|
||
model-name: ${DEEPSEEK_MODEL:}
|
||
api-key: ${DEEPSEEK_API_KEY:}
|
||
manifest-url: ${DSH_MANIFEST_URL:}
|
||
github-release-url: ${DSH_GITHUB_RELEASE_URL:https://api.github.com/repos/deepseek-ai/deepseek-harness/releases/latest}
|
||
install-root: ${DSH_INSTALL_ROOT:${user.home}/.mateclaw/runtimes/deepseek-harness}
|
||
server:
|
||
# Public base URL used to build absolute download links for tool-generated
|
||
# files (e.g. https://mateclaw.example.com). Leave empty to fall back to the
|
||
# current request's host, and to a relative path when no request is bound.
|
||
# Set this when agents deliver download links to channels/clients that cannot
|
||
# resolve a relative URL (IM messages, copied links, external downloads).
|
||
public-base-url: ${MATECLAW_PUBLIC_BASE_URL:}
|
||
openapi:
|
||
# SpringDoc OpenAPI 元信息(驱动 /swagger-ui.html 与 /v3/api-docs)。
|
||
# server-url 留空时由 SpringDoc 从请求 host 推导,避免 Try it out 打到错误地址。
|
||
# 生产若需固定,通过 MATECLAW_OPENAPI_SERVER_URL 覆盖(如 https://mate.example.com)。
|
||
title: ${MATECLAW_OPENAPI_TITLE:MateClaw REST API}
|
||
version: ${MATECLAW_OPENAPI_VERSION:1.0}
|
||
server-url: ${MATECLAW_OPENAPI_SERVER_URL:}
|
||
# description 留空则使用 OpenApiConfig 中的内置默认描述
|
||
description: ${MATECLAW_OPENAPI_DESCRIPTION:}
|
||
# 是否公开 Swagger UI / OpenAPI 文档路径(/swagger-ui*、/v3/api-docs*、/webjars/**)。
|
||
# true = 任何人可浏览(本地开发 / 内网默认);
|
||
# false = 需要全局管理员(ROLE_ADMIN)才能访问,由 SecurityConfig 强制。
|
||
# 生产数据库 profile(mysql/kingbase/postgres)默认覆盖为 false。
|
||
expose-ui: ${MATECLAW_OPENAPI_EXPOSE_UI:true}
|
||
jwt:
|
||
secret: ${JWT_SECRET:MateClaw-JWT-Secret-Key-2024-Please-Change-In-Production}
|
||
expiration: 86400000
|
||
sso:
|
||
# 全局开关(默认关闭,不影响现有部署)
|
||
enabled: ${SSO_ENABLED:false}
|
||
# 「仅允许绑定已有账号」模式(false = 允许自动创建新用户)
|
||
link-only: ${SSO_LINK_ONLY:false}
|
||
# 新建 SSO 用户的默认角色
|
||
default-role: ${SSO_DEFAULT_ROLE:user}
|
||
feishu:
|
||
enabled: ${SSO_FEISHU_ENABLED:false}
|
||
app-id: ${SSO_FEISHU_APP_ID:}
|
||
app-secret: ${SSO_FEISHU_APP_SECRET:}
|
||
# 国际版切换: feishu (国内) / lark (国际版 Lark)
|
||
domain: ${SSO_FEISHU_DOMAIN:feishu}
|
||
# SSO 回调地址,通常 https://your-domain/login?sso=callback
|
||
redirect-uri: ${SSO_FEISHU_REDIRECT_URI:}
|
||
# 搜索配置已迁移至数据库(mate_system_setting 表),通过 UI 系统设置管理
|
||
# MCP server 配置已迁移至数据库(mate_mcp_server 表),通过 UI 管理
|
||
mcp:
|
||
enabled: true
|
||
tools:
|
||
disclosure:
|
||
# progressive: deferred schemas stay behind tool_search/tool_describe and
|
||
# execute through tool_call in the same action round. enable_tool remains
|
||
# available only for backwards compatibility with older conversations.
|
||
# legacy: advertise every bound tool up front (pre-disclosure behavior).
|
||
mode: ${MATECLAW_TOOLS_DISCLOSURE_MODE:progressive}
|
||
context:
|
||
prefix-budget:
|
||
# Ratio remains useful for small contexts; this hard ceiling is what keeps
|
||
# a provider-declared 1M window from advertising ~30k schema tokens forever.
|
||
tool-schema-max-tokens: ${MATECLAW_TOOL_SCHEMA_MAX_TOKENS:12000}
|
||
workspace:
|
||
sandbox:
|
||
# Global fallback filesystem boundary for file/shell tools. When a
|
||
# conversation has no per-workspace base path configured, operations are
|
||
# confined to this root instead of running unconstrained against the whole
|
||
# filesystem (fail-closed default). Set enabled=false to restore the legacy
|
||
# unconstrained behaviour for unconfigured conversations.
|
||
enabled: ${MATECLAW_WORKSPACE_SANDBOX_ENABLED:true}
|
||
root: ${MATECLAW_WORKSPACE_SANDBOX_ROOT:${user.dir}/data/workspace}
|
||
chat:
|
||
upload:
|
||
# Root directory for conversation chat attachments when neither the active
|
||
# agent nor its workspace configures a base path. Attachments resolve to
|
||
# {baseDir}/{conversationId}/{storedName}. When a workspace/agent base path
|
||
# IS configured, attachments land under {basePath}/chat-uploads/{convId}/
|
||
# instead; reads and cleanup still check this default dir so legacy uploads
|
||
# remain resolvable. Defaults to the legacy location for zero-config parity.
|
||
base-dir: ${MATECLAW_CHAT_UPLOAD_BASE_DIR:data/chat-uploads}
|
||
# Organize new attachments/generated media into per-day sub-directories:
|
||
# {convDir}/yyyy-MM-dd/{storedName}. Serving URLs stay flat and reads
|
||
# probe both layouts, so this can be toggled at any time; files written
|
||
# under the previous layout remain resolvable either way. The day is the
|
||
# server's local date (a UTC container groups by UTC days).
|
||
date-folders: ${MATECLAW_CHAT_UPLOAD_DATE_FOLDERS:true}
|
||
skill:
|
||
reflection:
|
||
# Out-of-band skill reflection: after a conversation reaches the cadence
|
||
# below, an async reviewer reads the recent window and creates or
|
||
# improves skills through the same skill_manage pipeline the agent uses.
|
||
# Runs off the request thread, so it never consumes the live turn's
|
||
# context window.
|
||
# Explicit opt-in: transcript/catalog content may be sent to the selected
|
||
# model provider. auto-apply is a second, independent mutation gate.
|
||
enabled: ${MATECLAW_SKILL_REFLECTION_ENABLED:false}
|
||
auto-apply: ${MATECLAW_SKILL_REFLECTION_AUTO_APPLY:false}
|
||
# Review once this many new messages have accumulated since the last
|
||
# attempt. 0 disables the cadence gate entirely.
|
||
review-turn-interval: ${MATECLAW_SKILL_REFLECTION_TURN_INTERVAL:8}
|
||
# Substance floor — a window with fewer assistant turns than this rarely
|
||
# contains a reusable workflow, so the review is skipped before any LLM
|
||
# call is made.
|
||
min-assistant-turns: ${MATECLAW_SKILL_REFLECTION_MIN_ASSISTANT_TURNS:2}
|
||
# Most recent messages handed to the reviewer.
|
||
max-messages: ${MATECLAW_SKILL_REFLECTION_MAX_MESSAGES:24}
|
||
# Per-conversation cooldown between reviews, in minutes. Applies on top
|
||
# of the cadence gate, so a busy conversation reviews at most this often.
|
||
cooldown-minutes: ${MATECLAW_SKILL_REFLECTION_COOLDOWN_MINUTES:30}
|
||
# Hard cap on create/edit/patch actions applied by a single review.
|
||
max-actions-per-run: ${MATECLAW_SKILL_REFLECTION_MAX_ACTIONS:3}
|
||
# Character budget for the existing-skill catalog shown to the reviewer.
|
||
# Skill bodies are truncated to fit; the reviewer is told not to target
|
||
# truncated text with a patch.
|
||
catalog-char-budget: ${MATECLAW_SKILL_REFLECTION_CATALOG_BUDGET:8000}
|
||
# Reviewer model id. Empty follows the system default model.
|
||
model-id: ${MATECLAW_SKILL_REFLECTION_MODEL_ID:}
|
||
routine:
|
||
# Routine mining: a nightly cross-session pass that clusters the opening
|
||
# request of recent conversations and promotes the ones the user makes
|
||
# habitually into class-level skills. Recurrence is invisible to the
|
||
# per-conversation reflection reviewer above — inside one window a weekly
|
||
# request is indistinguishable from a one-off — so this pass supplies the
|
||
# cross-session evidence that reviewer structurally cannot see.
|
||
# Explicit opt-in because mining persists conversation-derived patterns
|
||
# and promotion sends evidence to the selected model provider.
|
||
enabled: ${MATECLAW_SKILL_ROUTINE_ENABLED:false}
|
||
cron: ${MATECLAW_SKILL_ROUTINE_CRON:0 0 3 * * *}
|
||
# How far back each sweep looks. A routine the user stops doing decays
|
||
# out of this window on its own.
|
||
lookback-days: ${MATECLAW_SKILL_ROUTINE_LOOKBACK_DAYS:30}
|
||
# Shingle-similarity above which two openers count as the same request.
|
||
# Tuned toward precision — a false merge invents a routine the user does
|
||
# not have, which is worse than missing one until the next sweep.
|
||
similarity-threshold: ${MATECLAW_SKILL_ROUTINE_SIMILARITY:0.62}
|
||
# Promotion gate. Both must hold: occurrences proves repetition, distinct
|
||
# days proves habit rather than one afternoon of retries.
|
||
min-occurrences: ${MATECLAW_SKILL_ROUTINE_MIN_OCCURRENCES:3}
|
||
min-distinct-days: ${MATECLAW_SKILL_ROUTINE_MIN_DISTINCT_DAYS:3}
|
||
# Shortest opener worth clustering, and the prefix length fed to the
|
||
# shingler.
|
||
min-opener-chars: ${MATECLAW_SKILL_ROUTINE_MIN_OPENER_CHARS:8}
|
||
max-opener-chars: ${MATECLAW_SKILL_ROUTINE_MAX_OPENER_CHARS:400}
|
||
# Conversation ids retained per candidate as promotion evidence.
|
||
max-samples-per-candidate: ${MATECLAW_SKILL_ROUTINE_MAX_SAMPLES:8}
|
||
# Candidates promoted per sweep, bounding LLM cost per run.
|
||
max-promotions-per-run: ${MATECLAW_SKILL_ROUTINE_MAX_PROMOTIONS:2}
|
||
# Conversations scanned per sweep, bounding query and memory cost.
|
||
max-conversations-per-run: ${MATECLAW_SKILL_ROUTINE_MAX_CONVERSATIONS:1000}
|
||
# Transcript shaping for the synthesis prompt.
|
||
transcript-messages-per-sample: ${MATECLAW_SKILL_ROUTINE_TRANSCRIPT_MESSAGES:12}
|
||
transcript-truncate-chars: ${MATECLAW_SKILL_ROUTINE_TRANSCRIPT_TRUNCATE:800}
|
||
# Synthesis model id. Empty follows the system default model.
|
||
model-id: ${MATECLAW_SKILL_ROUTINE_MODEL_ID:}
|
||
upload:
|
||
# Size caps for skill bundle ZIPs (upload endpoint and marketplace
|
||
# install). The archive is buffered in memory during extraction, so
|
||
# max-total-size-mb also bounds peak heap usage per install. Uploads
|
||
# additionally pass through spring.servlet.multipart limits above.
|
||
max-entry-size-mb: ${MATECLAW_SKILL_UPLOAD_MAX_ENTRY_SIZE_MB:1}
|
||
max-total-size-mb: ${MATECLAW_SKILL_UPLOAD_MAX_TOTAL_SIZE_MB:50}
|
||
workspace:
|
||
# Skill workspace root. Override with MATECLAW_SKILL_WORKSPACE_ROOT to
|
||
# relocate it onto a persistent volume — in Docker this is pointed at
|
||
# /app/data/skills so the existing server_data volume persists installed
|
||
# skills, accumulated LESSONS.md, and skill runtime files across restarts.
|
||
root: ${MATECLAW_SKILL_WORKSPACE_ROOT:${user.home}/.mateclaw/skills}
|
||
auto-init: true
|
||
delete-policy: archive
|
||
disclosure:
|
||
load-skill-tool:
|
||
# When false, the load_skill meta tool is not advertised to agents and
|
||
# the skill catalog guidance falls back to readSkillFile. Escape hatch
|
||
# for operators who don't want the explicit skill-load entry point.
|
||
enabled: ${MATECLAW_SKILL_LOAD_SKILL_TOOL_ENABLED:true}
|
||
curator:
|
||
enabled: true
|
||
cron: "0 0 2 * * *" # daily 02:00 — staggered away from wiki / backup jobs
|
||
stale-after-days: 30
|
||
archive-after-days: 90
|
||
# AGENT_CREATED scopes the sweep to skills written autonomously
|
||
# (origin=agent|routine). Skills a user asked for in a conversation are
|
||
# stamped origin=user and are never aged out under this scope.
|
||
scope: AGENT_CREATED # AGENT_CREATED | ALL_DYNAMIC | OFF
|
||
protect-prefixes:
|
||
- "sys-"
|
||
- "ops-"
|
||
# Restore point captured before every mutating sweep. The sweep archives
|
||
# skills and, with consolidation on, rewrites their bodies — unattended
|
||
# and overnight, so a bad pass is usually noticed long after it ran.
|
||
# Disabling this makes those changes one-way.
|
||
backup-enabled: ${MATECLAW_SKILL_CURATOR_BACKUP_ENABLED:true}
|
||
backup-keep: ${MATECLAW_SKILL_CURATOR_BACKUP_KEEP:5}
|
||
hub:
|
||
base-url: https://clawhub.ai
|
||
search-path: /api/v1/search
|
||
skills-path: /api/v1/skills
|
||
download-path: /api/v1/download
|
||
http-timeout: 15
|
||
http-retries: 3
|
||
plugin:
|
||
enabled: true
|
||
user-dir: ${user.home}/.mateclaw/plugins
|
||
# RFC-017: 声明式 Hook 系统
|
||
hooks:
|
||
enabled: true
|
||
global-rate-limit: 200 # 全局每秒最大派发数
|
||
global-concurrency: 32 # 同时活跃的派发任务上限
|
||
dispatch-deadline: 5s # 单事件派发硬预算
|
||
trusted-domains: [] # HttpAction 允许调用的域名(精确或后缀匹配),留空禁用 HTTP
|
||
http:
|
||
connect-timeout: 2s
|
||
read-timeout: 3s
|
||
audit:
|
||
enabled: true # 每次派发写 mate_hook_run
|
||
retain-days: 7
|
||
security:
|
||
# Hosts/IPs/CIDR blocks allowed through the SSRF guards (browser, hooks, image
|
||
# download) even though they are loopback/private/link-local/metadata. Each
|
||
# entry is a literal hostname, a literal IP, or an IPv4 CIDR block. Keep narrow.
|
||
# Example: [192.168.100.100, 192.168.100.0/24, internal.corp]
|
||
ssrf-allowlist: []
|
||
# RFC-014: Anthropic prompt cache 标记
|
||
llm:
|
||
cache:
|
||
enabled: true # 总开关;false 时全部走 NoOp
|
||
min-prompt-tokens: 1024 # 累计 prompt token 低于此值则跳过缓存(避免 cache write 倒亏)
|
||
max-breakpoints: 4 # 单请求最多打几个 cache_control 断点(Anthropic 上限 4)
|
||
ttl: DEFAULT # DEFAULT(5min) | EXTENDED_1H(需要 anthropic-beta header)
|
||
include-tools-block: true # 工具 schema 段是否独立打断点(CONVERSATION_HISTORY 策略)
|
||
adaptive:
|
||
enabled: true # 自适应降级(连续 miss 后短路到 NoOp,冷却后恢复)
|
||
miss-threshold: 5
|
||
cool-down-ms: 60000
|
||
# RFC-009 P3.3: per-provider health tracker for the multi-model failover chain.
|
||
# When a provider hits failure-threshold consecutive failures it enters a cooldown
|
||
# window during which the chain walker skips it, avoiding repeated 5-retry stalls
|
||
# against a known-broken provider on every conversation turn.
|
||
failover:
|
||
health:
|
||
enabled: true
|
||
failure-threshold: 3
|
||
cooldown-ms: 300000
|
||
# Multi-agent delegation (DelegateAgentTool).
|
||
delegation:
|
||
# Wall-clock budget for one delegateParallel batch (shared across all
|
||
# children — they run concurrently on virtual threads, so this is total
|
||
# latency, not per-child). 300 s headroom is needed because thinking
|
||
# models (Kimi / GLM / MiniMax) routinely take 90–290 s per LLM turn
|
||
# when the child must produce multi-section structured output.
|
||
parallel-timeout-seconds: 300
|
||
# Default wall-clock budget for detached delegateAsync children. A caller
|
||
# may request a different positive timeout up to 86400 seconds; keeping a
|
||
# default bound prevents abandoned background children from running forever.
|
||
async-timeout-seconds: 3600
|
||
|
||
# MateClaw Agent 配置
|
||
mate:
|
||
channel:
|
||
# 入站消息去重:IM 平台在 ack 迟到 / 丢失 / 非 200 时会重投同一条消息,
|
||
# 不去重则每次重投都会跑一轮完整 Agent 回合,用户看到重复答复。
|
||
dedup:
|
||
enabled: true
|
||
# 需明显长于各平台重投窗口(秒级到分钟级)
|
||
ttl: 5m
|
||
max-size: 2000
|
||
agent:
|
||
# Deterministic Markdown cleanup of the final answer (heading spaces, glued
|
||
# ---, table pipe alignment) before persistence / channel delivery. Set to
|
||
# false to pass model output through verbatim.
|
||
markdown-normalize-enabled: true
|
||
reasoning:
|
||
# How much of a turn's reasoning reaches the message record.
|
||
# all — every iteration's reasoning, kept where it happened. The
|
||
# reasoning behind each tool call is what a replay needs.
|
||
# terminal — only the iteration that produced the final answer. Smaller
|
||
# rows, but a long tool loop persists as a bare conclusion.
|
||
retention: all
|
||
graph:
|
||
observation:
|
||
# 与 GraphObservationProperties.java 默认值对齐,参考 openclaw token-budget 设计
|
||
max-single-observation-chars: 16000
|
||
max-total-observation-chars: 200000
|
||
large-result-threshold: 32000
|
||
min-rounds-for-summarize: 25
|
||
head-ratio: 0.4
|
||
truncation-marker: "\n\n...[TRUNCATED: %d chars total, middle omitted. Do NOT infer or fabricate omitted content; retrieve the full data (e.g. read_file) or tell the user the result is incomplete.]...\n\n"
|
||
tool:
|
||
timeout:
|
||
default-timeout-seconds: 300
|
||
per-category:
|
||
shell: 120
|
||
web: 30
|
||
# Tool-result budget (per-result spill + per-turn aggregate budget).
|
||
# The executor tries to spill the RAW result first so the full output is
|
||
# preserved on disk; the in-context preview points the agent at the spill
|
||
# file via read_file. When spill is disabled, the tool is on the exclusion
|
||
# list, the body is at or below the threshold, or the disk write fails,
|
||
# the executor falls back to inline hard-truncation to the same character
|
||
# cap. Per-turn aggregate caps the combined size across one tool turn.
|
||
tool-result:
|
||
enabled: true
|
||
per-result-threshold-chars: 8000 # aligned with executor hard cap; > this size → spill, ≤ → inline verbatim
|
||
per-turn-budget-chars: 32000 # headroom for multi-tool turns
|
||
preview-head-chars: 800
|
||
excluded-tool-inline-chars: 2500
|
||
storage-base-dir: ""
|
||
# Retrieval-style tools that must NEVER be spilled. Spilling read_file's
|
||
# output causes a recursion: the agent reads the spill path, that read also
|
||
# exceeds the threshold, gets spilled to a new path, agent reads that one,
|
||
# ad infinitum until MAX_TOOL_CALLS_PER_STEP is hit. Add MCP-provided
|
||
# readers here if they have the same role.
|
||
# readSkillFile / load_skill deliberately return the full SKILL.md so the
|
||
# model never misses mandatory sections (API parameter tables etc.);
|
||
# spilling them defeats that and leaves the model an 800-char preview,
|
||
# causing wrong-parameter tool calls. Their references/scripts reads are
|
||
# already self-paginated to 8000 chars, so excluding them stays bounded.
|
||
excluded-tools:
|
||
- read_file
|
||
- read_workspace_memory_file
|
||
- readSkillFile
|
||
- load_skill
|
||
# Spill files are deleted after this many days. Default 0 disables the
|
||
# scheduled sweep entirely so a summary/preview that points at a spill
|
||
# path stays valid for the whole life of the conversation. Files are
|
||
# still purged when the conversation is deleted explicitly via
|
||
# ConversationService.deleteConversation. Raise to a positive value if
|
||
# disk pressure outweighs recoverability for your deployment.
|
||
retention-days: 0
|
||
cleanup-cron: "0 0 3 * * ?"
|
||
conversation:
|
||
window:
|
||
# 测试时临时调低:2000 token ≈ 2000 中文字,3 轮对话即可触发压缩
|
||
# 生产环境应改回 128000
|
||
default-max-input-tokens: 128000
|
||
compact-trigger-ratio: 0.75
|
||
preserve-recent-pairs: 2
|
||
summary-max-tokens: 300
|
||
# Wiki 知识库配置
|
||
wiki:
|
||
enabled: true # 是否启用 Wiki 知识库功能
|
||
max-chunk-size: 30000 # LLM 单次处理最大字符数(超过则分块)
|
||
max-context-chars: 10000 # 注入 Agent prompt 的 Wiki 摘要最大字符数
|
||
max-pages-per-raw: 15 # 单个原始材料最多生成的 Wiki 页面数
|
||
max-parallel-phase-b-pages: 3 # RFC-012 follow-up #3:单 chunk 内 phase B 阶段并行处理的 page 数
|
||
auto-process-on-upload: true # 上传原始材料后是否自动触发 AI 消化
|
||
upload-dir: ./data/wiki-uploads # 上传文件存储目录
|
||
max-scan-files: 500 # 目录扫描最大文件数
|
||
max-scan-file-size: 52428800 # 扫描时跳过大于此大小的文件(字节,默认 50MB)
|
||
# Dream v2 feature flags — production defaults after GA validation
|
||
memory:
|
||
# Phase 1: lifecycle mediator wiring
|
||
lifecycle-mediator-enabled: true
|
||
dream:
|
||
focused-enabled: true
|
||
archive-enabled: true
|
||
archive-keep-days: 30
|
||
max-candidates-per-dream: 100
|
||
# Phase 2: SOUL auto-evolution and provider decorators
|
||
soul-update-interval: 20 # 20 writes trigger one SOUL.md LLM update (0 = off)
|
||
provider-retry-attempts: 1 # 1 = no retry (enable when external providers added)
|
||
provider-metrics-enabled: false # actuator dependency now present; enable when external providers added
|
||
# Phase 3: fact projection
|
||
fact:
|
||
projection-enabled: true
|
||
projection-rebuild-cron: "0 */30 * * * ?"
|
||
llm-extraction-enabled: false # placeholder impl, enable after Phase 3 L4+
|
||
contradiction-check-enabled: false # experimental simple detection, enable after LLM batch impl
|
||
trust-half-life-days: 60
|
||
forget-enabled: true
|
||
# Always-on injection budget — bounds the per-turn size of the user/feedback structured block
|
||
system-block-max-chars: 4000 # char cap on the always-on block; over budget drops oldest by Updated date (LRU); 0 = unlimited
|
||
system-block-max-entries-per-type: 40 # max entries injected per type (user/feedback); 0 = unlimited
|
||
# Structured-memory consolidation — separate maintenance task; LLM merges duplicate/stale user/feedback entries (shared + per-owner) to curb storage growth
|
||
structured-consolidation-enabled: true # off = injection cap only, no storage-side merge
|
||
structured-consolidation-min-entries: 8 # buckets with fewer entries skip the LLM call to save cost
|
||
structured-consolidation-cron: "0 30 3 * * ?" # own schedule, decoupled from dreaming-enabled / dreaming-cron
|
||
structured-consolidation-max-owners-per-run: 50 # cap LLM cost per agent per run; remaining owners picked up next run; 0 = unlimited
|
||
# Always-on file ceilings — deterministic backstop so PROFILE.md / MEMORY.md (LLM-rewritten) cannot grow per-turn context without bound
|
||
profile-max-chars: 4000 # PROFILE.md hard cap; truncates at a section boundary if the rewrite overruns; 0 = unlimited
|
||
memory-md-max-chars: 8000 # MEMORY.md hard cap; 0 = unlimited
|