fix(tests): update resource alias syntax from 'res:' to 'res://' in tests and registry

Refactor tests and registry to use the new 'res://' syntax for resource aliases, ensuring consistency across the codebase. This change addresses alias handling in various test cases, including stream processing and registry encoding, to prevent data loss and improve resource reference management.
This commit is contained in:
wizardchen
2026-07-15 16:55:39 +08:00
committed by lyingbug
parent 38c594aec3
commit 0f4500b98f
4 changed files with 22 additions and 19 deletions
+2 -2
View File
@@ -53,7 +53,7 @@ func (m *mockChat) ChatStream(
func TestStreamLLMResourceAliasesRoundTrip(t *testing.T) {
const ref = "resource://AbCdEfGhIjKlMnOpQrStUv"
model := &mockChat{responses: []mockResponse{{chunks: []types.StreamResponse{
{ResponseType: types.ResponseTypeAnswer, Content: "![image](res:0"},
{ResponseType: types.ResponseTypeAnswer, Content: "![image](res://0"},
{ResponseType: types.ResponseTypeAnswer, Content: "001)", Done: true},
}}}}
engine := newTestEngine(t, model)
@@ -66,7 +66,7 @@ func TestStreamLLMResourceAliasesRoundTrip(t *testing.T) {
require.NoError(t, err)
require.Equal(t, "![image]("+ref+")", result.Content)
require.Len(t, model.calls, 1)
require.Equal(t, "source=res:0001", model.calls[0][0].Content)
require.Equal(t, "source=res://0001", model.calls[0][0].Content)
}
func (m *mockChat) Chat(_ context.Context, _ []chat.Message, _ *chat.ChatOptions) (*types.ChatResponse, error) {