INNER CODE UNIT · Go

model

voocel/ainovel-cli · internal/agents/agentcore_contract_test.go:153

			model := &contractModel{fn: func(int, []agentcore.Message) (*agentcore.LLMResponse, error) {
				return &agentcore.LLMResponse{Message: assistantText("dead", stop)}, nil
			}}
			_ = runSubagent(t, subagent.Config{
				Name: "dying", Description: "contract", Model: model,
				SystemPrompt: "test", MaxTurns: 5,
				StopGuardFactory: func(_, _ string) agentcore.StopGuard {
					return func(context.Context, agentcore.StopInfo) agentcore.StopDecision {
						guardCalls.Add(1)
						return agentcore.StopDecision{Allow: true}
					}
				},
			}) // error/aborted 停机的 error 语义由 subagent 层定义,这里只关心 guard 是否被触达
			if guardCalls.Load() != 0 {
				t.Fatalf("%s 停机不应触达 StopGuard,got %d 次咨询", stop, guardCalls.Load())
			}
		})
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…