docs(runtime): internal/runtime/loop 44 个文件注释改中文(逐行 1:1,代码零字节改动)
主人 2026-10-03 拍板「注释一律中文」;本模块按长期分批协议(一个模块一次派工)执行。 注释行数 1329 → 1329 逐行 1:1(含中文 33 → 1304);行尾注释 5 条一并译。 校验:机械校验(非注释改动行)= 空;独立 Go AST 程序(剥注释复渲)证明 44/44 文件代码全等; 全树 go test ./... 58 包 ok / 0 FAIL;交叉编译绿。 gofmt:capacity_loop_test.go / flow.go 改动前即未格式化,按铁律保留原样未动。
This commit is contained in:
1 parent
355f81d04a
commit
91e8d7a029
44 files changed
+1315
-1315
No files matched your search
@@ -9,9 +9,9 @@ import (
|
||||
"git.yeij.top/AskaEth/Cyrene_v2/internal/runtime/tool"
|
||||
)
|
||||
|
||||
// capacityToolSet builds a dispatcher over the four representative tools used to
|
||||
// verify the allowed-set filter: two quiet tools, one awake-only, and one that is
|
||||
// never allowed in quiet/awake.
|
||||
// capacityToolSet 为验证允许集过滤所用的四个代表性工具
|
||||
// 构建一个 dispatcher:两个 quiet 工具、一个仅 awake 的,
|
||||
// 以及一个在 quiet/awake 下永不被允许的。
|
||||
func capacityToolSet(t *testing.T) *tool.Dispatcher {
|
||||
t.Helper()
|
||||
return dispatcherWith(t,
|
||||
@@ -22,9 +22,9 @@ func capacityToolSet(t *testing.T) *tool.Dispatcher {
|
||||
)
|
||||
}
|
||||
|
||||
// toolNames returns the set of tool names advertised in specs. The registry
|
||||
// List iterates a map, so registration order is not preserved; compare with a
|
||||
// set (via toolSet) rather than a slice for order-independent assertions.
|
||||
// toolNames 返回 specs 中广告出的工具名集合。registry 的
|
||||
// List 遍历 map,因此注册顺序不保留;做与顺序无关的断言时
|
||||
// 应与集合(经 toolSet)比较,而不是与切片比较。
|
||||
func toolNames(specs []model.ToolSpec) []string {
|
||||
out := make([]string, 0, len(specs))
|
||||
for _, s := range specs {
|
||||
@@ -50,9 +50,9 @@ func hasAll(set map[string]bool, names ...string) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// TestLoop_Capacity_QuietHidesHeavierTools verifies that with an enabled capacity
|
||||
// decider a chitchat turn advertises only the quiet allowed set to the model
|
||||
// (terminal + file, not web-search/json) on the streaming path.
|
||||
// TestLoop_Capacity_QuietHidesHeavierTools 验证启用 capacity
|
||||
// 判定器时,闲聊 turn 在流式路径上只向模型广告 quiet 允许集
|
||||
// (terminal + file,不含 web-search/json)。
|
||||
func TestLoop_Capacity_QuietHidesHeavierTools(t *testing.T) {
|
||||
t.Parallel()
|
||||
td := capacityToolSet(t)
|
||||
@@ -80,8 +80,8 @@ func TestLoop_Capacity_QuietHidesHeavierTools(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestLoop_Capacity_WakeExposesWebSearch verifies a task turn exposes the awake
|
||||
// allowed set (adds web-search) to the model.
|
||||
// TestLoop_Capacity_WakeExposesWebSearch 验证任务 turn 向模型
|
||||
// 暴露 awake 允许集(增加 web-search)。
|
||||
func TestLoop_Capacity_WakeExposesWebSearch(t *testing.T) {
|
||||
t.Parallel()
|
||||
td := capacityToolSet(t)
|
||||
@@ -106,8 +106,8 @@ func TestLoop_Capacity_WakeExposesWebSearch(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestLoop_Capacity_NilKeepsAllTools verifies the pre-existing behavior: without
|
||||
// a capacity decider every registered tool is advertised (no filtering).
|
||||
// TestLoop_Capacity_NilKeepsAllTools 验证既有行为:没有
|
||||
// capacity 判定器时,每个已注册工具都被广告(不过滤)。
|
||||
func TestLoop_Capacity_NilKeepsAllTools(t *testing.T) {
|
||||
t.Parallel()
|
||||
td := capacityToolSet(t)
|
||||
@@ -126,8 +126,8 @@ func TestLoop_Capacity_NilKeepsAllTools(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestLoop_Capacity_EmitsAwakenEvent verifies a state change surfaces a
|
||||
// capacity_awaken event through the OnCapacity hook on the streaming path.
|
||||
// TestLoop_Capacity_EmitsAwakenEvent 验证状态变化在流式路径上
|
||||
// 经 OnCapacity 钩子浮出一个 capacity_awaken 事件。
|
||||
func TestLoop_Capacity_EmitsAwakenEvent(t *testing.T) {
|
||||
t.Parallel()
|
||||
td := capacityToolSet(t)
|
||||
|
||||
Reference in new issue
Block a user