CellSpec 调度配置
wesgine CellSpec 中调度相关字段的声明式配置。
Quotas
计算、存储、外设和执行的多维配额:
spec := wesgine.CellSpec{
Quotas: wesgine.CellQuotas{
MaxConcurrentRuns: 5,
TokensPerMinute: 100000,
TokensPerDay: 5000000,
MaxIMChannels: 10,
MaxMCPServers: 5,
MaxCronJobs: 20,
MaxEmailAccounts: 3,
MaxSkillsInstalled: 50,
MaxPlugins: 10,
},
}
CycleDetect
循环检测配置:
spec := wesgine.CellSpec{
CycleDetect: wesgine.CycleDetectConfig{
ExplorationTermThreshold: 100,
ActionTermThreshold: 50,
IdenticalCallTermThreshold: 7,
},
}
支持运行时热更新:PUT /cells/{id}/config/cycle-detect。
FaultPolicyOverride
故障策略覆盖:
- 覆盖默认的故障处理行为
- Per-cell 定义故障容忍度
SkillPolicy
技能策略:
- 控制技能安装和执行的策略
- 签名验证策略
InboxCap
Inbox 容量限制:
- 控制 Cell 的 Inbox 缓冲区大小
- 超出时的排队策略
Roles
角色定义:
- 定义 Cell 内可用角色
- 角色与权限的映射
Per-Run CycleDetect 覆盖
单次 Run 可覆盖 CellSpec 级阈值:
events, err := cell.Runtime().Run(ctx, AppRunRequest{
CycleDetectOverride: &CycleDetectConfig{
ActionTermThreshold: 40,
IdenticalCallTermThreshold: 5,
},
})
用于委派子 Run 使用更严格的阈值。
运行时更新
配额
PATCH /cells/{id}/quotas
循环检测
PUT /cells/{id}/config/cycle-detect
Feature Flags
PUT /cells/{id}/config/features
三者互不影响,各自独立生效。