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:
AskaEth committed 2026-10-03 22:28:21 +08:00
1 parent 355f81d04a
commit 91e8d7a029
44 files changed
+1315 -1315

No files matched your search

+6 -6
View File
@@ -84,8 +84,8 @@ func TestRun_ToolCallThenFinal_FeedsBack(t *testing.T) {
func TestRun_MaxRounds(t *testing.T) {
t.Parallel()
// Distinct calls per round so the critical-tool-loop safety net does not
// intervene; the goal here is to exercise the round budget.
// 每轮使用不同的调用,使关键工具循环安全网不会
// 介入;这里的目标是演练轮次预算。
call1 := `{"tool_calls":[{"name":"echo","args":{"q":"x"}}]}`
call2 := `{"tool_calls":[{"name":"echo","args":{"q":"y"}}]}`
ad := &mockAdapter{chat: []mgResp{
@@ -233,8 +233,8 @@ func TestRun_MemoryInject(t *testing.T) {
if _, err := l.Run(context.Background(), "sess", nil); err != nil {
t.Fatalf("Run: %v", err)
}
// An empty conversation still routes through injectMemory; the retriever
// returns the persona's items by recency when the query is blank.
// 空对话仍会走 injectMemory;查询为空时 retriever
// 按最近程度返回该角色的条目。
if len(ad.reqs) == 0 {
t.Fatal("no request captured")
}
@@ -354,8 +354,8 @@ func TestNew_DefaultMaxRounds(t *testing.T) {
}
}
// decodeSpanLines reads every JSON span emitted as JSONL into recs, failing the
// test if any line is malformed.
// decodeSpanLines 把作为 JSONL 发出的每个 JSON span 读入 recs,
// 任何一行格式错误都让测试失败。
func decodeSpanLines(t *testing.T, data []byte) []trace.SpanRecord {
t.Helper()
sc := bufio.NewScanner(bytes.NewReader(data))