Documentation
¶
Overview ¶
max_turns.go — 轮数上限的**唯一真源**(§二十一 已红第 12 条「`max_turns` 三处不等(100 / 30 / 20)」· 批 C 的 T-34)。
病灶(照已红原话):**同一条上限三个真源** —— 命令行默认(100)· 主循环兜底(30)· 子任务配额(20), 加上 `loop.go` 里还有第四处兜底(100)。四个数字各有各的历史,谁改一处另外三处不会跟着动, 而且**没有任何东西会报红**:现象只是「同一条命令在不同入口下跑到不同的轮数」。
口径(三条,逐条可机检):
① **主上限只有一个数**:命令行 `-max-turns` 的默认值、`Config.MaxTurns == 0` 的兜底、 `newLoop` 收到非正数时的兜底 —— 三处**全部**取 `DefaultMaxTurns`,不许再出现字面量。 ② **子任务配额从主上限派生**(`SubAgentMaxTurns`):子任务**绝不许比主任务宽** —— 派生写法让这条关系是构造上的,而不是靠两个数字碰巧一个比另一个小。 ③ **子任务的默认值不许回到同一个数**:`DefaultMaxTurns > SubAgentMaxTurns` 是一条断言 (见 `max_turns_test.go`)—— 有人把子配额调成 100,那条测试当场红。
walkbudget.go — 遍历预算(丙:治大卷上 glob/grep 无节制遍历,实测一次 glob 87 秒)。
为什么不是"加个 timeout 就完事":超时只会**掐断**,模型仍拿不到结果、还会重试 ⇒ 更糟。 正确做法是**少走**:给遍历一个**条目上限 + 时间上限**,到顶就**停并如实说明**(可行动 ✓)。 参照 grep 1.0.1 设计稿同源口径(范围/上限/早停)。
Index ¶
- Constants
- Variables
- func AppendToolEvent(tool string, durMs int64)
- func BashCheckRmHome(command string) error
- func BashOverflowDir() string
- func CanDead(content, currentStatus string) (string, error)
- func CanEscalate(content, currentStatus string) (string, error)
- func CanRetry(content string) (string, error)
- func ClassifyFailure(reason TerminateReason) string
- func ClusterFailuresReport(clusters []FailureCluster) string
- func CommitOnStateChange(workDir, issuePath, newState string) (bool, error)
- func CreateIssue(workDir string, task string, reason TerminateReason, retryCount int, ...) (string, error)
- func ExtraToolNames() map[string]bool
- func GetDeviceName(devices []DeviceConfig) string
- func GitCommit(repoDir, message string) error
- func InitToolUses()
- func InitToolVersions()
- func IsFatal(err error) bool
- func IsTransient(err error) bool
- func IsValidPriority(p string) bool
- func IsValidSource(s string) bool
- func IsValidStatus(s string) bool
- func IsValidTaskType(t string) bool
- func LoadSearchCache()
- func MarkIssueStatus(content string, status string) string
- func ObserveToolAllow(session, tool string, args map[string]any)
- func ObserveToolDeny(session, tool, reason string, args map[string]any)
- func RecordToolUse(name string)
- func RegisterExtraTool(t ExtraTool)
- func RegisterPluginTool(pluginName string, def ToolDef)
- func ResetCommitHookState()
- func ResetToolUses()
- func Retry(fn func() error, policy RetryPolicy) error
- func ScreenshotAndOCR(path string, vision bool) (string, error)
- func SubmitTask(spec TaskSpec) (string, error)
- func TodoWrite(todos []TodoItem) (string, error)
- func ToolUses(name string) int
- func ToolUsesAll() map[string]int
- func ToolVersion(name string) string
- func TransitionIssue(content, from, to string) (string, error)
- func UnregisterPluginTools(pluginName string) int
- func ValidateWorkersConfig(devices []DeviceConfig) []string
- func Verify(issuePath, workDir string) (bool, string)
- func WebFetch(rawURL string) (string, error)
- func WebSearch(query string, limit int) (string, error)
- func WebSearchV2(p SearchParams) (string, error)
- type Agent
- func (a *Agent) AppendMessage(m Message)
- func (a *Agent) History() []Message
- func (a *Agent) RestoreFromLog() int
- func (a *Agent) RunWithKernel(ctx context.Context, tools []ToolDef, logger *Logger, ...) (result LoopResult)
- func (a *Agent) SetAdapter(ad ModelAdapter)
- func (a *Agent) SetChecker(c Checker)
- func (a *Agent) SetGate(g ToolGater)
- func (a *Agent) SetLogger(l *Logger)
- func (a *Agent) SetMCPManager(m *MCPManager)
- func (a *Agent) SetResultHandler(f func([]ToolCallResult))
- func (a *Agent) SetSessionLog(sl *SessionLog)
- func (a *Agent) SetSkillManager(sm *SkillManager)
- func (a *Agent) SetState(s *agentstate.HarnessState)
- func (a *Agent) SetTerminator(t Terminator)
- func (a *Agent) State() *agentstate.HarnessState
- type AuditEntry
- type CATerminator
- type Checker
- type ComboChecker
- type Config
- type Decision
- type DeviceAwareConfig
- type DeviceConfig
- type DockerWorker
- type EventEntry
- type EventType
- type ExecContext
- type ExtraTool
- type FailureCluster
- type FunctionDef
- type IdleDetector
- func (d *IdleDetector) Run(stop <-chan struct{})
- func (d *IdleDetector) SetAutoCheck(f func(defID string) bool)
- func (d *IdleDetector) SetEnabled(on bool)
- func (d *IdleDetector) SetExternalQueue(f func() int)
- func (d *IdleDetector) SetOnTrigger(f func(InternalTask, string))
- func (d *IdleDetector) SetResourceIdle(f func() bool)
- type InternalTask
- type IssueRecord
- type LLMChoice
- type LLMError
- type LLMJudge
- type LLMJudgeRequest
- type LLMJudgeResponse
- type LLMMessage
- type LogLevel
- type Logger
- func (l *Logger) Close()
- func (l *Logger) LogAudit(toolName string, args any, prompt, decision, result, errStr, agent string)
- func (l *Logger) LogError(errType, msg, context string)
- func (l *Logger) LogEvent(etype, level, action, toolName, prompt string, args any, ...)
- func (l *Logger) LogTranscript(role, content, toolName, toolCallID string, args any, ...)
- type LoopResult
- type MCPManager
- func (mm *MCPManager) Call(serverName, toolName string, args map[string]any) (string, error)
- func (mm *MCPManager) Close()
- func (mm *MCPManager) Connect(name string, command string, args ...string) error
- func (mm *MCPManager) ConnectHTTP(name string, baseURL string, headers map[string]string) error
- func (mm *MCPManager) ToolDefs(extended bool) []ToolDef
- type MemoryStore
- func (m *MemoryStore) AddToHot(content string) error
- func (m *MemoryStore) ListFacts() []string
- func (m *MemoryStore) ReadHot() string
- func (m *MemoryStore) Search(query string, limit int) []string
- func (m *MemoryStore) WriteFact(content, tags string) (string, error)
- func (m *MemoryStore) WriteMem(memType, content, tags string) (string, error)
- type Message
- type ModelAdapter
- type ModelResponse
- type NoProgressDetector
- type ParsedIssue
- type Priority
- type RetryPolicy
- type Scheduler
- type SearchParams
- type SearchResult
- type SearxngResponse
- type SessionLog
- type Skill
- type SkillManager
- type SubagentConfig
- type SubagentResult
- type SubagentType
- type SysMetric
- type SysMetricsCollector
- type TaskInput
- type TaskSpec
- type TerminateReason
- type Terminator
- type TestChecker
- type TodoItem
- type ToolCall
- type ToolCallResult
- type ToolDef
- type ToolEvent
- type ToolGater
- type TranscriptEntry
- type Worker
- type WorkerRunner
- type WorkersConfig
Constants ¶
const ( ExitSuccess = 0 ExitFailed = 1 ExitError = -1 )
ExitCode — 退出码含义 0: 成功(fixing → verified → done) 1: 失败(fixing → failed,触发冷却/重派/死信) -1: 执行异常(容器启动失败等)
const ( TaskTypeCode = "code" // 代码任务(修复/重构/新功能) TaskTypeReport = "report" // 报告任务(分析/调研/文档) TaskTypeResearch = "research" // 研究任务(技术调研/方案验证) TaskTypeFix = "fix" // 修复任务(bug 修复/错误自愈) )
Task Type — 任务类型枚举
const ( TaskPriorityHigh = "high" // 高优先级(阻塞/紧急) TaskPriorityNormal = "normal" // 正常优先级 TaskPriorityLow = "low" // 低优先级 )
Priority — 优先级枚举
const ( SourceGit = "git" // Git 事件触发(push/PR/issue) SourceCron = "cron" // 定时任务触发 SourceAPI = "api" // API 调用触发 SourceA2A = "a2a" // Agent-to-Agent 触发 )
Source — 任务来源枚举
const ( StatusOpen = "open" // 新创建,待分配 StatusQueued = "queued" // 已排队 StatusRunning = "running" // 正在处理 StatusFixing = "fixing" // 正在修复 StatusVerified = "verified" // 已验证通过 StatusWaitReview = "waiting_review" // C4: 验收通过——等脑确认复查(v2.5.3) StatusDone = "done" // 已关闭(终态) StatusRetry = "retry" // 需要重试 StatusEscalated = "escalated" // 已升级(终态) StatusDead = "dead" // 已放弃(终态) )
Issue Status — v2.5.2 完整状态枚举
const ( // DefaultMaxTurns —— 主循环轮数上限(唯一真源)。v2.5 起是 100: // v2.5 之前是 30,研究类任务(要 100+ 轮)会被腰斩;自主停止(模型自己说完成)才是主路, // 这个数只是**安全兜底**。 DefaultMaxTurns = 100 // SubAgentMaxTurns —— 子任务(`spawn_agent`)每层配额。**从主上限派生**: // 口径是「子任务不许比主任务宽」,所以它是 DefaultMaxTurns 的 1/5(= 20,与历史值一致)。 SubAgentMaxTurns = DefaultMaxTurns / 5 )
const ( DefaultMaxRetries = 3 DefaultBaseBackoff = 2 * time.Second )
默认重试策略配置
Variables ¶
var DefaultTools = []ToolDef{
toolBash(),
toolRead(),
toolWrite(),
toolEdit(),
toolGlob(),
toolGrep(),
toolLs(),
toolWebSearch(),
toolWebFetch(),
toolSkillLoad(),
toolToolSearch(),
toolScreenshot(),
toolApplyPatch(),
toolSpawnAgent(),
toolTodo(),
}
DefaultTools — 默认工具(静态——内置)
Functions ¶
func AppendToolEvent ¶
AppendToolEvent — 导出的工具事件追加(对话侧 chat 包调用——CA 侧在 ExecuteTool 内联)
func BashCheckRmHome ¶
BashCheckRmHome — 导出给 chat_gate 等复用(2026-09-07 事故修复): 展开家目录形态后做 rm 参数级目标防护(/、家目录本身/祖先/内部 → 拒)
func BashOverflowDir ¶
func BashOverflowDir() string
BashOverflowDir 溢出落盘目录(2026-09-18 修 /tmp 硬编码——口径同 api/tasks_persist.go)。
原写死 const BashOverflowDir = "/tmp/zerg-bash-overflow" —— macOS 重启 /tmp 即清、 tmp_cleaner 3 天未访问即删(溢出原文丢);多实例还共用同一目录。 改为 statepath 统一状态目录派生(ZERG_STATE_DIR → ~/.zerg/state/zerg-bash-overflow); 新目录不存在则首次使用自动创建(bashSpillDir)。
由常量改为函数:常量无法按 ZERG_STATE_DIR 派生,且测试需要可覆盖。
func CanEscalate ¶
CanEscalate — 将 issue 升级为终态 escalated(任意非终态→escalated)
func ClassifyFailure ¶
func ClassifyFailure(reason TerminateReason) string
ClassifyFailure — 失败分类(LoopResult → error_type——SWE-bench 枚举)
func ClusterFailuresReport ¶
func ClusterFailuresReport(clusters []FailureCluster) string
ClusterFailuresReport — 生成聚类报告(调试用)
func CommitOnStateChange ¶
CommitOnStateChange — testonly: 导出仅测试用,无外部调用者(见 commit_hook_test.go) issue 状态变更时触发 commit workDir: 工作区根目录(issue 文件所在仓库) issuePath: issue 文件相对路径(如 "issues/20260814-150405-abc1.md"——任务区目录;旧目录 docs/issues/ 已于 2026-09-19 分家) newState: 新状态(如 "queued" / "running" / "done") 返回 (committed bool, error) — committed 表示是否真正执行了 commit
func CreateIssue ¶
func CreateIssue(workDir string, task string, reason TerminateReason, retryCount int, toolTrace []string) (string, error)
CreateIssue — 挂单(失败 → 任务区 <issuesDir>/instance_id.md——git 提交由调用方) 返回 issue 文件路径
func GetDeviceName ¶
func GetDeviceName(devices []DeviceConfig) string
GetDeviceName — 获取当前设备名称(调试/日志用)
func GitCommit ¶
GitCommit — 在指定仓库执行 git add -A + git commit repoDir: git 仓库根目录 message: commit message(支持中文) 失败返回 error(不 panic)
func IsFatal ¶
IsFatal - 判断错误是否为致命错误(不可重试)
致命错误:语法错误、权限不足、文件不存在、格式错误等——重试无意义 与 IsTransient 互补:一个 error 不可能同时是 transient 和 fatal
func IsTransient ¶
IsTransient - 判断错误是否为瞬时错误(可重试)
瞬时错误:网络断开、超时、5xx 服务端错误等——稍后可能自动恢复 致命错误:语法错误、权限不足、资源不存在等——重试无意义
func LoadSearchCache ¶
func LoadSearchCache()
LoadSearchCache — 启动时加载缓存(main 调用) 读路径:新(统一状态目录)优先;新缺失 + 旧 /tmp 在 ⇒ 读旧一次(2026-09-18 迁移兼容)
func MarkIssueStatus ¶
MarkIssueStatus — 更新 issue 状态(open→fixing→resolved/escalated)
func ObserveToolAllow ¶
ObserveToolAllow — 给**不经过 ExecuteTool** 的工具调用补一条 allow(对话层自执行的 tool_search/kb_search)。
存在的理由:没有它,"被调用但没记录"会和"没调用"再次混同——正是本任务要消掉的盲区。 语义仍是判定层放行(这些工具在 agent 判定层之外,其自身错误照样由轨迹记录)。
func ObserveToolDeny ¶
ObserveToolDeny — 同上,给判定层之外的调用方补一条 deny(保留给对话层自执行工具的拒绝分支)。
func RecordToolUse ¶
func RecordToolUse(name string)
RecordToolUse 工具调用计数 +1(对话/CA 统一——成功执行才计) 2026-09-06: flock 读-改-写盘——多进程不互覆(原整体覆盖丢计数)
func RegisterExtraTool ¶
func RegisterExtraTool(t ExtraTool)
RegisterExtraTool — 注册扩展工具(对话层启动时调用——重复注册覆盖)
func RegisterPluginTool ¶
RegisterPluginTool 插件注册工具(可逆副作用——记录归属)
func ResetCommitHookState ¶
func ResetCommitHookState()
ResetCommitHookState — testonly: 仅测试用(见 commit_hook_test.go),不删除 测试用:重置防重复状态
func Retry ¶
func Retry(fn func() error, policy RetryPolicy) error
Retry - 带指数退避的有界重试
fn: 要执行的函数,接收 error 参数(nil 表示成功) policy: 重试策略
执行流程:
- 调用 fn()
- 失败且可重试 → 退避 sleep → 重试
- <=MaxRetries 次后成功 → 返回 nil
- 不可重试 / 次数耗尽 → 返回最后一次错误
func ScreenshotAndOCR ¶
ScreenshotAndOCR 截图 + 识别(虫族看图工具) path: 图片路径(空=截全屏) vision: 是否用视觉模型语义理解(可选——较慢)
func SubmitTask ¶
SubmitTask — 统一任务提交入口(四类源:git/cron/api/a2a)
流程:
- 校验 TaskSpec
- 计算 task hash,检查去重(同 hash 且未关闭 → 返回已有路径)
- 生成 issue 文件写入任务区(旧目录 <工作区>/docs/issues/ 已于 2026-09-19 分家至 Zerg-内部文档/issues/; 「内部任务单目录可配」落地后写单落点见 statepath.IssuesDir())
返回:issue 文件路径
func TransitionIssue ¶
TransitionIssue — 校验并执行 issue 状态流转 content: issue markdown 全文 from: 当前状态 to: 目标状态 返回: (新 content, error) 非法流转返回 error,非法状态也返回 error
func UnregisterPluginTools ¶
UnregisterPluginTools 插件卸载撤销工具(可逆副作用——从注册表移除)
func ValidateWorkersConfig ¶
func ValidateWorkersConfig(devices []DeviceConfig) []string
ValidateWorkersConfig — 验证设备配置合法性
func Verify ¶
Verify — 验收函数 读 issue 文件(任务描述+类型)→ 按类型验收 → 返回 (通过, 原因)
验收规则:
- code:检查 workDir 下是否有测试文件(.go test)或构建产物
- report:检查报告中引用的文件是否存在且非空
- research:检查报告文件是否存在
- fix:检查修复描述是否存在
通用:从 issue 内容中提取验收目标(如 "写报告 /tmp/x.md"),检查文件存在
func WebSearch ¶
WebSearch — 调 searxng 搜索(v2.5:直接调 Python 桥——不走 HTTP 服务) 复用 Hermes 同款 searx 引擎(searxng-src 库——内存调引擎)
func WebSearchV2 ¶
func WebSearchV2(p SearchParams) (string, error)
WebSearchV2 — v1.0.1 完整搜索(query 重写 → 缓存 → 桥 → 格式化 → 自动抓取)
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
Agent - 虫族 Agent(替代 Codex 的手)
func (*Agent) AppendMessage ¶
AppendMessage - 追加消息到历史(任务指令/用户输入) v2.5.5 P1: 同时写会话日志(日志=上下文真相——模型可见即已记录——2026-08-21 Mr2109)
func (*Agent) RestoreFromLog ¶
RestoreFromLog - 从会话日志恢复历史(CA 崩溃/续跑——日志=权威) 返回恢复的消息数(0=无日志/新会话)
func (*Agent) RunWithKernel ¶
func (a *Agent) RunWithKernel(ctx context.Context, tools []ToolDef, logger *Logger, state *agentstate.HarnessState, maxTurns int, budget int64, noProgressThresh int) (result LoopResult)
RunWithKernel — CA 任务用内核跑(Loop() 的内核版——渐进切换: 先并行存在——验证稳定后 Loop 转发此处) 返回 LoopResult 兼容现有出口(退出码语义/挂单/复查链不动)
func (*Agent) SetAdapter ¶
func (a *Agent) SetAdapter(ad ModelAdapter)
SetAdapter 设置模型适配器(v2.5.4.7——注入插件——nil 保持老逻辑)。
func (*Agent) SetChecker ¶
SetChecker - 注入验证器(maker/checker 分离)
func (*Agent) SetMCPManager ¶
func (a *Agent) SetMCPManager(m *MCPManager)
SetMCPManager — 设置 MCP 管理器(main 连接后注入)
func (*Agent) SetResultHandler ¶
func (a *Agent) SetResultHandler(f func([]ToolCallResult))
SetResultHandler - 注入工具结果处理器
func (*Agent) SetSessionLog ¶
func (a *Agent) SetSessionLog(sl *SessionLog)
SetSessionLog - 注入会话日志(main 创建 Agent 后设置)
func (*Agent) SetSkillManager ¶
func (a *Agent) SetSkillManager(sm *SkillManager)
SetSkillManager — 设置 skill 管理器(main 初始化后注入)
func (*Agent) SetState ¶
func (a *Agent) SetState(s *agentstate.HarnessState)
SetState - 注入 HarnessState
type AuditEntry ¶
type AuditEntry struct {
TaskID string
ToolName string
Args any
Prompt string
Decision string
Result string
Error string
Agent string
Duration string
Timestamp time.Time
}
AuditEntry - audit.jsonl 每行一条(M3 安全对齐)
type CATerminator ¶
type CATerminator struct {
// contains filtered or unexported fields
}
CATerminator — CA 终止仲裁(内核 Terminator 实现) 判定序: ①done 词缺报告→引导写报告 ②多轮无行动→诊断引导 ③确认完成→verifiedOutput 强制完成 (契约核验在外层 VerifyTaskOutput/Contract——此处只管循环内「模型说完成」的仲裁——与原 handleNoToolCalls 同语义)
func (*CATerminator) OnNoToolCall ¶
func (t *CATerminator) OnNoToolCall(resp *loopcore.Response) (bool, string)
type ComboChecker ¶
type ComboChecker struct {
Checkers []Checker // 要依次执行的验证器列表
}
ComboChecker — 依次执行多个验证器,全部通过才判定为 done
type Config ¶
type Config struct {
Model string `json:"model"` // 模型
GatewayURL string `json:"gateway_url"` // 网关地址
AuthToken string `json:"auth_token"` // X-Auth-Token
MaxTurns int `json:"max_turns"` // 最大轮数
Budget int64 `json:"budget"` // token 预算
Timeout time.Duration `json:"timeout"` // 网关超时
ContextWindow int `json:"context_window"` // v2.5.4.9 滚动窗口压缩——保留最近 N 轮完整(默认 5——Mr2109)
WorkDir string `json:"work_dir"` // 工作区
StateDir string `json:"state_dir"` // 状态目录
Temperature float64 `json:"temperature"` // 采样温度(v2.5:默认 0.3——低温稳定工具调用)
}
Config - Agent 配置
type DeviceAwareConfig ¶
type DeviceAwareConfig struct {
Devices []DeviceConfig `yaml:"devices"`
}
DeviceAwareConfig — config/workers.yaml 完整结构
type DeviceConfig ¶
type DeviceConfig struct {
Hostname string `yaml:"hostname"`
MaxWorkers *int `yaml:"max_workers"` // nil=未给(回退默认)· 0=显式暂停 · >0=并发上限
}
DeviceConfig — 单个设备的并发配置
type DockerWorker ¶
type DockerWorker struct {
// contains filtered or unexported fields
}
DockerWorker — 容器化 worker 封装 docker run 命令构造 + 执行 + 退出码解析 cmdRunner 可注入(测试 mock——生产默认 docker exec.CommandContext)
func NewDockerWorker ¶
func NewDockerWorker(image, agentBin string) *DockerWorker
NewDockerWorker — 创建容器化 worker image: 镜像名(默认 "zerg-dev") agentBin: 宿主机 zerg-agent 路径(默认 /tmp/zerg-agent-linux-arm64)
func (*DockerWorker) Run ¶
func (dw *DockerWorker) Run(issuePath, workDir string) (int, error)
Run — 在容器中执行 zerg-agent(--issue 接单模式) issuePath: issue 文件绝对路径(宿主机) workDir: 任务工作区绝对路径(宿主机) 返回: exitCode(0=成功), error
func (*DockerWorker) RunDev ¶
func (dw *DockerWorker) RunDev(repoDir, workDir, task, branch string) (int, error)
RunDev — C4 开发模式:容器内双目录挂载——开发仓库(/workspace) + 任务区(/tasks) repoDir: 开发仓库路径(宿主机——纯代码——git管理——容器内 /workspace) workDir: 任务区路径(宿主机——docs/issues/——容器内 /tasks) task: 开发任务描述 branch: 分支名(如 task-<id>) 返回: exitCode(0=成功), error
func (*DockerWorker) SetCmdRunner ¶
func (dw *DockerWorker) SetCmdRunner(fn func(ctx context.Context, name string, args ...string) (int, error))
SetCmdRunner — 注入命令执行器(测试 mock——生产不设置,默认 docker exec)
type EventEntry ¶
type EventEntry struct {
Seq int64
TaskID string
Type string
Level string
Action string
ToolName string
Prompt string
Args any
Result string
Error string
Step int
Duration string
Timestamp time.Time
}
EventEntry - events.jsonl 每行一条
type EventType ¶
type EventType string
EventType - 事件类型枚举
const ( EventToolCall EventType = "tool_call" EventToolResult EventType = "tool_result" EventToolDenied EventType = "tool_denied" EventToolError EventType = "tool_error" EventModelCall EventType = "model_call" EventModelResult EventType = "model_result" EventLoopStart EventType = "loop_start" EventLoopEnd EventType = "loop_end" EventPrompt EventType = "prompt" EventAbort EventType = "abort" EventCheckpoint EventType = "checkpoint" )
type ExecContext ¶
type ExecContext struct {
WorkDir string // 工作区根目录
Timeout time.Duration // 命令超时(默认 30s)
OutputMax int // 输出最大字符数(默认 2000)
AgentName string // agent 名称(用于 gate 日志)
// v2.5.5 P2: 父 agent 引用(spawn_agent 子 agent 委托——2026-08-21 Mr2109)
Parent *Agent
// S10: 白名单目录(任务目录——结晶模式报告写入——validatePath 例外)
ExtraAllowDirs []string
// ── T1.2 观测(实现见 tool_decision.go)──
// Session: 会话 id(**只观测**;空 ⇒ 观测面无 trace/span 骨架——不编造 id)
// obs: 本次调用的判定作用域(工具名/参数摘要/是否已记拒绝)
Session string
// contains filtered or unexported fields
}
ExecContext — 工具执行上下文
func (*ExecContext) ExecuteTool ¶
func (ec *ExecContext) ExecuteTool(ctx context.Context, toolName string, args map[string]any, gate ToolGater) ToolCallResult
ExecuteTool — 根据工具名路由到对应执行函数 执行前过 gate 检查,返回 ToolCallResult
type ExtraTool ¶
type ExtraTool struct {
Name string // 工具名
Desc string // 描述(工具列表/搜索用)
Fn func(args map[string]any, workDir string) (string, error) // 执行器
}
ExtraTool — 扩展工具(对话层注册——CA/对话通用)
func LookupExtraTool ¶
LookupExtraTool — 查询扩展工具(ExecuteTool 路由用)
type FailureCluster ¶
type FailureCluster struct {
Key string `json:"key"` // 簇标识(失败类型:任务hash前4位)
ErrorType string `json:"error_type"` // 失败类型
Count int `json:"count"` // 簇内 issue 数量
IssueIDs []string `json:"issue_ids"` // 簇内所有 issue ID
SuggestedRoot string `json:"suggested_root"` // 建议根因
}
FailureCluster — 失败簇(同类失败合并后的分组)
func ClusterFailures ¶
func ClusterFailures(issuesDir string) ([]FailureCluster, error)
ClusterFailures — 扫描 issuesDir 中的失败 issue(escalated/dead),按失败类型+任务关键词聚类 issuesDir: 任务区目录路径(旧目录 docs/issues/ 已于 2026-09-19 分家至 Zerg-内部文档/issues/) 返回: 簇列表(按 Count 降序排列)
type FunctionDef ¶
type FunctionDef struct {
Name string `json:"name"`
Description string `json:"description"` // "怎么用"(含示例/边界)——模型靠它学会
Parameters map[string]any `json:"parameters"` // JSON Schema
}
FunctionDef — 工具函数定义(name + description + parameters)
type IdleDetector ¶
type IdleDetector struct {
// contains filtered or unexported fields
}
IdleDetector 空闲检测器——定时检查外部任务队列 + 资源空闲
func (*IdleDetector) Run ¶
func (d *IdleDetector) Run(stop <-chan struct{})
Run 启动空闲检测循环(每 5 分钟检查一次)
func (*IdleDetector) SetAutoCheck ¶
func (d *IdleDetector) SetAutoCheck(f func(defID string) bool)
SetAutoCheck 注入运行模式检查(main.go 注入 api.IsInternalAuto——避免 agent→api 循环依赖)
func (*IdleDetector) SetEnabled ¶
func (d *IdleDetector) SetEnabled(on bool)
SetEnabled 开关(外部任务多时禁用)
func (*IdleDetector) SetExternalQueue ¶
func (d *IdleDetector) SetExternalQueue(f func() int)
SetExternalQueue 注入外部队列检查函数
func (*IdleDetector) SetOnTrigger ¶
func (d *IdleDetector) SetOnTrigger(f func(InternalTask, string))
SetOnTrigger 注入触发回调(v2.5.5 测试6——触发后调总调度器 Submit——闭环) v2.5.5 P1-3: 回调带 issuePath(任务单路径——总调度器完成时更新状态)
func (*IdleDetector) SetResourceIdle ¶
func (d *IdleDetector) SetResourceIdle(f func() bool)
SetResourceIdle 注入资源空闲检查函数
type InternalTask ¶
type InternalTask struct {
ID string // 任务类型 ID(如 "tool-check")
Description string // 人类可读描述
Template string // 任务描述模板(派 CA 用——含工作区/要求)
Cooldown time.Duration // 冷却时间(同类型防重复)
}
InternalTask 内部任务定义
func ListInternalTasks ¶
func ListInternalTasks() []InternalTask
ListInternalTasks 导出内部任务清单(2026-08-22 Mr2109——UI 分类显示)
type IssueRecord ¶
type IssueRecord struct {
InstanceID string `json:"instance_id"` // 唯一标识(时间戳+任务hash)
Task string `json:"task"` // 任务描述(截断 200)
ExitStatus string `json:"exit_status"` // failed/timeout/blocked/token_budget/model_error
ErrorType string `json:"error_type"` // 失败分类枚举
RetryCount int `json:"retry_count"` // 重试次数
AssignedAgent string `json:"assigned_agent"` // 派单 agent(默认 zerg-agent)
CreatedAt string `json:"created_at"` // 创建时间
LastAttemptAt string `json:"last_attempt_at"` // 最后尝试
ToolTrace []string `json:"tool_trace,omitempty"` // 工具调用轨迹(诊断用)
Status string `json:"status"` // open/fixing/resolved/escalated
Resolution string `json:"resolution,omitempty"` // 修复结论(agent 填)
}
IssueRecord — 失败问题单(SWE-bench 8 字段——本地任务区 issue 目录)
type LLMChoice ¶
type LLMChoice struct {
Message LLMMessage `json:"message"`
FinishReason string `json:"finish_reason,omitempty"`
}
LLMChoice — 单个 choice
type LLMJudge ¶
type LLMJudge struct {
GatewayURL string // 模型网关地址(如 "https://api.openai.com/v1/chat/completions")
AuthToken string // API 密钥
Model string // 模型名(如 "gpt-4o-mini")
}
LLMJudge — 通过独立模型网关评审内容是否达标 用法:LLMJudge{GatewayURL: "...", AuthToken: "...", Model: "gpt-4o-mini"} 设计:独立模型评审,防止 Agent 自评偏差
type LLMJudgeRequest ¶
type LLMJudgeRequest struct {
Model string `json:"model"`
Messages []LLMMessage `json:"messages"`
}
LLMJudgeRequest — 发送给模型网关的请求体
type LLMJudgeResponse ¶
type LLMJudgeResponse struct {
Error *LLMError `json:"error,omitempty"`
Choices []LLMChoice `json:"choices"`
}
LLMJudgeResponse — 网关返回的响应体
type LLMMessage ¶
LLMMessage — 单条消息(role + content)
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger - 虫族日志系统 线程安全(内部互斥锁),append-only(文件以 O_APPEND 打开)
func (*Logger) LogAudit ¶
func (l *Logger) LogAudit(toolName string, args any, prompt, decision, result, errStr, agent string)
LogAudit - 审计日志(M3 安全对齐——工具名+参数+触发 prompt+结果)
type LoopResult ¶
type LoopResult struct {
Reason TerminateReason // 终止原因
Turns int // 执行轮数
Tokens int64 // 累计 token
Content string // 最终内容
ToolTrace []string // v2.5.1 工具调用轨迹(挂单诊断用)
}
LoopResult - 循环执行完毕后的结果
func Loop ¶
func Loop(ctx context.Context, agent *Agent, tools []ToolDef, logger *Logger, state *agentstate.HarnessState, maxTurns int, budget int64, noProgressThresh int) (result LoopResult)
Loop 运行 Agent 主循环——每轮: 模型调用→工具执行→无进展检测,直到终止条件或 maxTurns 用尽 v2.5.1 挂单诊断: defer 捕获 ToolTrace 补全(所有出口都带完整工具轨迹)
func RunSubtaskLoop ¶
func RunSubtaskLoop(ctx context.Context, a *Agent, tools []ToolDef, logger *Logger, state *agentstate.HarnessState, maxTurns int) LoopResult
RunSubtaskLoop — 子任务结晶模式入口(2026-09-05 S5——ZERG_SUBTASK 路径) 拆解轮(强模型)→阶段执行(loopcore×本 Agent)→结晶→下一阶段——设计 3.3 落地
type MCPManager ¶
type MCPManager struct {
// contains filtered or unexported fields
}
MCPManager — MCP 服务器管理器(注册表 + 工具动态注册)
func (*MCPManager) Connect ¶
func (mm *MCPManager) Connect(name string, command string, args ...string) error
Connect — 连接一个 MCP 服务器(stdio——如 codegraph serve)
func (*MCPManager) ConnectHTTP ¶
ConnectHTTP — 连接远程 HTTP MCP 服务器(v2.5.1——anysearch 等) baseURL: https://api.anysearch.com/mcp——headers: 认证(Authorization Bearer)
func (*MCPManager) ToolDefs ¶
func (mm *MCPManager) ToolDefs(extended bool) []ToolDef
ToolDefs — 返回 MCP 工具定义(v2.5.1 分层——"只展示必要+更多选项")
extended=false: 只返回核心工具(当前 kb 的 4 个核心——codegraph/anysearch 无核心→空) extended=true: 返回全部(tool_search 用——模型搜索发现扩展)
type MemoryStore ¶
type MemoryStore struct {
Dir string // 记忆目录(.zerg/memory/{agentId}/)
HotFile string // 热记忆(MEMORY.md——上限 4KB)
}
MemoryStore — agent 私有记忆(一事实一文件——Files 即索引)
func NewMemoryStore ¶
func NewMemoryStore(agentID, baseDir string) *MemoryStore
NewMemoryStore — 创建记忆存储(建目录)
func (*MemoryStore) AddToHot ¶
func (m *MemoryStore) AddToHot(content string) error
AddToHot — 追加热记忆(超 4KB 截断)
func (*MemoryStore) Search ¶
func (m *MemoryStore) Search(query string, limit int) []string
Search — BM25 式搜索(词频 + IDF——不依赖外部库) 简化实现:查询词在记忆中出现的文档加权排序(词频 + 长度归一)
type Message ¶
type Message struct {
Role string `json:"role"`
Content string `json:"content"`
ToolCallID string `json:"tool_call_id,omitempty"`
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
}
Message - 对话消息(不可变,每轮新数组)
type ModelAdapter ¶
type ModelAdapter interface {
Call(ctx context.Context, sysPrompt string, messages []Message, tools []ToolDef) (*ModelResponse, error)
}
ModelAdapter 模型适配器接口(v2.5.4——主控零模型假设——适配器封装模型脾气)。
func NewPluginModelAdapter ¶
func NewPluginModelAdapter(p plugin.Plugin) ModelAdapter
NewPluginModelAdapter 创建桥(注入模型适配器插件)。
type ModelResponse ¶
type ModelResponse struct {
Content string
Reasoning string
// ReasoningOnly 标记「只有思考、无正文」(不把思考搬进 Content——见事故注释)
ReasoningOnly bool
ToolCalls []ToolCall
Finish string
Usage struct {
TotalTokens int64
}
}
ModelResponse — 模型响应(原 agent.go 定义——2026-09-05 随协议统一移入 types.go)
type NoProgressDetector ¶
type NoProgressDetector struct {
Threshold int
// contains filtered or unexported fields
}
NoProgressDetector - 连续 N 轮结果相同则判定无进展 线程安全,可在并发循环中使用
func NewNoProgressDetector ¶
func NewNoProgressDetector() *NoProgressDetector
NewNoProgressDetector - 创建无进展检测器(默认阈值 3)
func (*NoProgressDetector) Check ¶
func (npd *NoProgressDetector) Check(content string) (isNoProgress bool, count int)
Check - 检查无进展 content: 本轮结果内容(会被哈希)
返回 (isNoProgress, count):
isNoProgress: true 表示连续 N 次结果相同,判定为无进展 count: 当前连续相同次数
线程安全,可在并发循环中使用
func (*NoProgressDetector) Count ¶
func (npd *NoProgressDetector) Count() int
Count - 获取当前连续相同次数(线程安全)
type ParsedIssue ¶
type ParsedIssue struct {
Path string // 文件绝对路径
InstanceID string // 从文件名提取
Status string // 当前状态
Priority Priority // 优先级
RetryCount int // 当前重试次数
LastAttempt time.Time // 最后尝试时间
CreatedAt time.Time // 创建时间
Content string // 原始 markdown 内容
}
ParsedIssue — 调度器视角的 issue(从 markdown 文件解析)
type RetryPolicy ¶
RetryPolicy - 重试策略(有界 + 指数退避) 零值不是合法策略——MaxRetries 默认为 0,需在 Retry 前设置
type Scheduler ¶
type Scheduler struct {
// v2.5.3 容器模式(CA 脱离沙箱——docker run 完整环境)
ContainerMode bool // true=容器内执行 worker(默认 false=exec 兼容)
ContainerAgentBin string // Linux zerg-agent 路径(容器内挂载)
DevMode bool // C4: 开发模式(容器内分支开发→commit→PR——主仓库=workDir)
RepoDir string // v2.5.3: 开发仓库路径(纯代码——git管理——DevMode用)
// contains filtered or unexported fields
}
Scheduler — 任务调度器
func (*Scheduler) ActiveCount ¶
ActiveCount — 当前活跃 worker 数(调试用)
func (*Scheduler) ScanIssues ¶
func (s *Scheduler) ScanIssues() ([]ParsedIssue, error)
ScanIssues — 扫描任务单目录下所有 open/queued 状态的 issue 按优先级排序返回(高优先在前)
扫描面(2026-09-19「内部任务单目录可配」):
- ZERG_ISSUES_DIR 显式设置 ⇒ **只扫** statepath.IssuesDir()(唯一来源,旧目录完全不看、不 stat);
- 未显式设置 ⇒ statepath.IssuesDir() ∪ 旧目录 <workDir>/docs/issues(人类手写单照旧被派 = 读旧一次; 生产里 workDir 即仓库根,故旧目录就是仓内 docs/issues/)。
三条既有语义一字未改: **非递归**(只读顶层 .md)· 只取 open/queued · 要求粗体 `- **状态**: `。
func (*Scheduler) SetRunner ¶
func (s *Scheduler) SetRunner(r WorkerRunner)
SetRunner — 注入 worker runner(测试 mock——生产不需要调)
type SearchParams ¶
type SearchParams struct {
Query string // 搜索词
Limit int // 结果数(默认 5——auto 深度: 长 query 自动 8)
Lang string // 语言 all/zh/en...(ISO 639-1——searxng babel locale)
TimeRange string // 时间过滤 day/week/month/year(空=不限)
Domains []string // 限定域名(site: 操作符——信任站点)
FetchTop int // 自动抓取前 N 条正文(0=不抓——默认 1 更实用)
Rewrite bool // LLM query 重写(X3 9001——失败 fallback 规则)
}
SearchParams — web_search v1.0.1 参数(模型可控)
type SearchResult ¶
type SearchResult struct {
Title string `json:"title"`
URL string `json:"url"`
Content string `json:"content"`
}
SearchResult — searxng 搜索结果
type SearxngResponse ¶
type SearxngResponse struct {
Results []SearchResult `json:"results"`
}
SearxngResponse — searxng JSON 响应
type SessionLog ¶
type SessionLog struct {
// contains filtered or unexported fields
}
SessionLog 会话日志(追加写——JSON Lines)
func NewSessionLog ¶
func NewSessionLog(logDir string) (*SessionLog, error)
NewSessionLog 创建会话日志(写日志目录)
func (*SessionLog) Append ¶
func (sl *SessionLog) Append(m Message) error
Append 追加消息到会话日志(消息=上下文事实——模型可见即已记录)
func (*SessionLog) AppendAll ¶
func (sl *SessionLog) AppendAll(msgs []Message) error
AppendAll 批量追加(恢复历史——一次性)
func (*SessionLog) Load ¶
func (sl *SessionLog) Load() ([]Message, error)
Load 从会话日志恢复历史(日志=权威——重建上下文)
type Skill ¶
type Skill struct {
Name string // frontmatter name
Description string // frontmatter description(触发器)
Path string // SKILL.md 路径
Body string // 正文(触发时读取)
}
Skill — 一个技能(SKILL.md)
type SkillManager ¶
type SkillManager struct {
// contains filtered or unexported fields
}
SkillManager — 技能管理器
func (*SkillManager) ListDescriptions ¶
func (sm *SkillManager) ListDescriptions() string
ListDescriptions — 返回所有技能的 name+description(启动注入系统提示——轻量)
type SubagentConfig ¶
type SubagentConfig struct {
Type SubagentType // 子 agent 类型
Model string // 模型名称(explore 用轻量模型——nanbeige)
MaxTurns int // 每层配额——默认 SubAgentMaxTurns(见 max_turns.go)
Tools []string // 工具白名单(allowlist)
}
SubagentConfig — 子 agent 运行配置
type SubagentResult ¶
type SubagentResult struct {
TaskDesc string // 任务描述
Summary string // 精简摘要(1-2K 字符,父上下文干净)
Terminates TerminateReason // 终止原因
ToolUse string // 工具调用摘要(如 "read×3, grep×1")
}
SubagentResult — 子 agent 执行结果
func SpawnSubagent ¶
func SpawnSubagent(parent *Agent, task TaskInput) (SubagentResult, error)
SpawnSubagent — 派生子 agent 执行小任务,返回精简摘要
设计要点:
- 子 Agent 有独立 history(不继承父上下文,避免 token 爆炸)
- 复用 Agent 的 Loop 循环(直接调用 Loop 函数)
- MaxTurns 限制配额,防止子任务失控
- 返回摘要仅 1-2K 字符,父上下文保持干净
参数:
- parent: 父 agent(提供默认配置:网关/超时/工作区)
- task: 任务输入(描述/提示词/类型/模型)
返回:
- SubagentResult:摘要(子 agent 的工作成果)
- error:子 agent 执行失败时返回
type SubagentType ¶
type SubagentType string
SubagentType — 子 agent 类型标识
const ( TypeExplore SubagentType = "explore" // 探索:只读工具,快速了解代码库 TypePlan SubagentType = "plan" // 规划:只读工具,生成实施计划 TypeGeneral SubagentType = "general" // 通用:全部工具,执行具体任务 )
type SysMetric ¶
type SysMetric struct {
Timestamp time.Time `json:"ts"`
Step int `json:"step"`
// 本机
LocalCPU float64 `json:"local_cpu,omitempty"` // 本机 CPU %(总)
LocalMem float64 `json:"local_mem,omitempty"` // 本机内存 %
DiskRead float64 `json:"disk_read_mbps,omitempty"` // 磁盘读 MB/s
DiskWrite float64 `json:"disk_write_mbps,omitempty"` // 磁盘写 MB/s
// X3(agent 状态——如有)
X3GPU float64 `json:"x3_gpu,omitempty"` // X3 GPU %
X3CPU float64 `json:"x3_cpu,omitempty"` // X3 CPU %
X3Active int `json:"x3_active,omitempty"` // X3 活跃请求
X3MemAvail float64 `json:"x3_mem_avail_gb,omitempty"` // X3 可用内存 GB
}
SysMetric 单次采样(一轮)
type SysMetricsCollector ¶
type SysMetricsCollector struct {
// contains filtered or unexported fields
}
SysMetricsCollector 机器指标采集器(写 sysmetrics.jsonl)
func NewSysMetricsCollector ¶
func NewSysMetricsCollector(logDir, x3URL, token string) (*SysMetricsCollector, error)
NewSysMetricsCollector 创建采集器
func (*SysMetricsCollector) Sample ¶
func (c *SysMetricsCollector) Sample(step int)
Sample 采样一次(step 轮次)——轻量(<50ms)
type TaskInput ¶
type TaskInput struct {
Description string // 任务简述(用于日志/摘要)
Prompt string // 完整提示词(发给子 agent)
Type SubagentType // 子 agent 类型
Model string // 覆盖默认模型
}
TaskInput — 子 agent 执行的任务描述
type TaskSpec ¶
type TaskSpec struct {
Task string `json:"task"` // 任务描述
Type string `json:"type"` // 任务类型:code/report/research/fix
Priority string `json:"priority"` // 优先级:high/normal/low
Repo string `json:"repo"` // 关联仓库(可选)
Source string `json:"source"` // 来源:git/cron/api/a2a
}
TaskSpec — 任务规格(四类源统一入口)
type TerminateReason ¶
type TerminateReason string
TerminateReason - 循环终止状态(与 Claude Code 对齐)
const ( ReasonComplete TerminateReason = "complete" // 正常完成(checker 通过) ReasonUserAbort TerminateReason = "user_abort" // 用户中止 ReasonTokenBudget TerminateReason = "token_budget" // token 预算耗尽 ReasonMaxTurns TerminateReason = "max_turns" // 超过最大轮数 ReasonStopHook TerminateReason = "stop_hook" // 外部 stop hook ReasonMaxRetries TerminateReason = "max_retries" // 最大重试次数 ReasonModelError TerminateReason = "model_error" // 模型调用失败 ReasonToolError TerminateReason = "tool_error" // 工具不可恢复错误 ReasonEscalate TerminateReason = "escalate" // 升级给人 ReasonBlocked TerminateReason = "blocked" // 被门控拦截 )
type TestChecker ¶
type TestChecker struct {
Command string // 要执行的命令(如 "go test ./...")
}
TestChecker — 通过执行外部命令验证状态 用法:TestChecker{Command: "go test ./..."} Pass 判定:exit code == 0 → (true, 输出);非 0 → (false, 输出)
type TodoItem ¶
type TodoItem struct {
ID string `json:"id"`
Content string `json:"content"`
Status string `json:"status"` // pending/in_progress/completed
}
TodoItem — 计划项
type ToolCall ¶
type ToolCall struct {
ID string `json:"id"`
Name string `json:"name"`
Args map[string]any `json:"args"`
RawArgs string `json:"raw_args"`
RawCall string `json:"raw_call,omitempty"` // P4-47 模型输出原文(Hermes <tool_call> 原文——回传上下文用)
}
ToolCall - 模型输出的工具调用
type ToolCallResult ¶
type ToolCallResult struct {
ToolCallID string `json:"tool_call_id"`
ToolName string `json:"tool_name"` // 工具名(无进展检测用——v2.5)
Content string `json:"content"`
Error string `json:"error,omitempty"`
Duration string `json:"duration,omitempty"` // v2.5.4.9 工具执行耗时(CA 追踪)
}
ToolCallResult — 工具执行结果
type ToolDef ¶
type ToolDef struct {
Type string `json:"type"` // function
Function FunctionDef `json:"function"`
}
ToolDef — 工具定义(name + description + input_schema,工具自带说明)
type ToolEvent ¶
type ToolEvent struct {
Ts int64 `json:"ts"` // Unix 秒(时间维度——按天/月聚合)
Node string `json:"node"` // 执行节点(local/x3/...——未来多节点汇总)
Tool string `json:"tool"` // 工具名
DurMs int64 `json:"dur_ms"` // 执行耗时(毫秒——工作量参考)
}
ToolEvent — 单条工具事件(账本单元——未来节点上报聚合)
func ToolEventsOfDay ¶
ToolEventsOfDay — 查指定日(YYYY-MM-DD——历史回溯)
type TranscriptEntry ¶
type TranscriptEntry struct {
TaskID string
Step int
Role string
Content string
ToolName string
ToolCallID string
Args any
Result string
Error string
Duration string
Timestamp time.Time
}
TranscriptEntry - transcript.jsonl 每行一条(M4 蒸馏数据源)
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker — 独立 worker 执行体 封装 zerg-agent 执行 + 状态更新 + 失败处理
func (*Worker) SetRunner ¶
func (w *Worker) SetRunner(fn WorkerRunner)
SetRunner — 注入 runner(测试 mock——生产不设置,默认 exec zerg-agent)
type WorkerRunner ¶
WorkerRunner — worker 执行函数(可注入 mock——测试用——生产默认 exec zerg-agent) 返回退出码(0=成功)
type WorkersConfig ¶
type WorkersConfig struct {
MaxWorkers int `yaml:"max_workers"`
}
WorkersConfig — config/workers.yaml 配置
func LoadWorkersConfig ¶
func LoadWorkersConfig(workDir string) WorkersConfig
LoadWorkersConfig — 加载 workers.yaml 配置(v2.5.2 设备感知版) 1. 尝试读取 config/workers.yaml 2. 文件不存在 → 按 hostname 匹配内置默认值(mini1=1/X3=3/local=2) 3. 解析失败 → 回退到内置默认值 4. max_workers <= 0 → 回退默认值
Source Files
¶
- agent.go
- bash_v101.go
- ca_loop.go
- checker.go
- cluster.go
- commit_hook.go
- context_window.go
- docker_worker.go
- entry.go
- exec.go
- extra_tools.go
- idle_detector.go
- idle_persist.go
- issue_tracker.go
- logger.go
- loop.go
- max_turns.go
- mcp_manager.go
- memory.go
- net_tools.go
- plugin_adapter.go
- recovery.go
- scheduler.go
- screenshot.go
- session_log.go
- skill_manager.go
- subagent.go
- sysmetrics.go
- tool_decision.go
- tool_events.go
- tool_uses.go
- tools.go
- types.go
- verifier.go
- walkbudget.go
- worker.go
- workers_config.go