返回 DeepSeek-Reasonix
legacy_origin_fallback_test.go
根目录 / internal / agent / legacy_origin_fallback_test.go
1 package agent
2
3 import (
4 "testing"
5
6 "reasonix/internal/provider"
7 )
8
9 func TestLegacyOriginFallbackCoversCurrentHostMessageFamilies(t *testing.T) {
10 for _, content := range []string{
11 CompletionValidationContinuationPrefix + " the last message did not deliver a self-contained final result.",
12 StandardTodoContinuationPrefix + " Continue that item now using available tools.",
13 emptyFinalRetryMessage(),
14 executorHandoffRetryMessage(),
15 "This task has reached its token budget. Finalize now.",
16 "Your tool-call round limit (max_steps) has been reached.",
17 "The following tools are unavailable in the current workflow phase: ask.",
18 "Auto recovery has reached its limit for this turn. Summarize now.",
19 "Host progress check: the current todo has produced no new completion, unique read, command, or mutation for 8 tool-call rounds. Reassess before using more tools: sign off the current item if it is done, narrow the remaining work without replacing the active item, or explain/ask about a real blocker. Do not repeat reads, commands, or writes just to reset this guard.",
20 "Host progress redirect: choose a different approach.",
21 } {
22 legacy := provider.Message{Role: provider.RoleUser, Content: content}
23 if !IsHostGeneratedUserMessage(legacy) {
24 t.Errorf("legacy host message was not recognized: %q", content)
25 }
26 }
27 }
28
28 lines GO