mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-17 01:14:40 +08:00
Refine strategy creation flow and diagnostics
This commit is contained in:
@@ -171,7 +171,7 @@ func TestExecuteUnifiedTurnDecisionContinueActiveDoesNotHandOffToPlanner(t *test
|
||||
if !handled {
|
||||
t.Fatal("expected active session continuation to be handled")
|
||||
}
|
||||
if !strings.Contains(answer, "配置整理好了") || !strings.Contains(answer, "BTCUSDT") || strings.Contains(answer, "交易机器人") || strings.Contains(answer, "AI模型和交易所") {
|
||||
if !strings.Contains(answer, "还缺") || !strings.Contains(answer, "交易对") || strings.Contains(answer, "交易机器人") || strings.Contains(answer, "AI模型和交易所") {
|
||||
t.Fatalf("expected strategy session to continue without planner/trader handoff, got: %s", answer)
|
||||
}
|
||||
if _, ok := a.getActiveSkillSession(userID); !ok {
|
||||
@@ -220,6 +220,16 @@ func TestGuardUnsupportedAsyncPromiseBlocksFakeDiagnosisProgress(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestFinishTaskGuardBlocksFakeCreateProgressPromise(t *testing.T) {
|
||||
reply, blocked := guardUnsupportedAsyncPromise("zh", "策略正在创建中,请稍等一会儿。创建成功后我会立刻告诉您。")
|
||||
if !blocked {
|
||||
t.Fatal("expected fake create progress promise to be blocked")
|
||||
}
|
||||
if !strings.Contains(reply, "没有后台异步任务") || !strings.Contains(reply, "实际执行") {
|
||||
t.Fatalf("expected honest execution correction, got: %s", reply)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildUnifiedTurnRouterPromptNamesContextPolicy(t *testing.T) {
|
||||
a := New(nil, nil, DefaultConfig(), nil)
|
||||
systemPrompt, userPrompt := a.buildUnifiedTurnRouterPrompt(42, "zh", "不是交易员,是策略")
|
||||
|
||||
Reference in New Issue
Block a user