chore: 初始化仓库,导入项目基线代码
Academy v0.8.3 完整代码基线:Go 后端(internal/cmd/cli/mcp-server/docreader)、 Vue 前端(frontend)、数据库迁移(migrations)、部署编排(docker/helm/deploy)与文档。 今日开发的培训推送管理改动随后单独提交。
This commit is contained in:
commit
7ec21f35b0
5767 files changed
+1436788
No files matched your search
@@ -0,0 +1,30 @@
|
||||
package session
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"academy/internal/types"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestTitleModelFollowsValidatedConversationSelection(t *testing.T) {
|
||||
agent := &types.CustomAgent{Config: types.CustomAgentConfig{ModelID: "agent-model"}}
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
selected string
|
||||
agent *types.CustomAgent
|
||||
want string
|
||||
}{
|
||||
{"input overrides agent", "input-model", agent, "input-model"},
|
||||
{"input without agent", "input-model", nil, "input-model"},
|
||||
{"absent or cleared override uses agent", "", agent, "agent-model"},
|
||||
{"unconfigured agent keeps default fallback", "", &types.CustomAgent{}, ""},
|
||||
{"no selection keeps default fallback", "", nil, ""},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
rc := &qaRequestContext{summaryModelID: tc.selected, customAgent: tc.agent}
|
||||
require.Equal(t, tc.want, rc.titleModelID())
|
||||
require.Equal(t, "agent-model", agent.Config.ModelID, "selection must not rewrite agent settings")
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user