User authorized lifting CURRENT FAV whole-branch merge protection on 2026-09-23. Keep FAV_DEGRADED_READ/FAV_PUBLISHER_ENABLED default false. Drop duplicate goose 00034 (local_dev already has 00036). Preserve agentx workspace admin routes and pin-export wiring.
32 lines
997 B
Go
32 lines
997 B
Go
package server
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"chat-agent-system/internal/artifactvault"
|
|
"chat-agent-system/internal/config"
|
|
"chat-agent-system/internal/taskrun"
|
|
)
|
|
|
|
func TestIngestAssistantReplyRegistersArtifact(t *testing.T) {
|
|
cfg := &config.Config{Env: "dev", AllowInMemory: true, DataDir: t.TempDir()}
|
|
reg := artifactvault.NewMemoryRegistry()
|
|
s := &Server{cfg: cfg, vaultReg: reg, vaultIngest: &artifactvault.Ingest{Env: "dev", Reg: reg}}
|
|
ctx := context.Background()
|
|
record := &taskrun.RunRecord{
|
|
RunID: "run-fav", SessionID: "sess-fav", ClientTurnID: "turn-fav", ProjectID: 3, AssistantMsgID: 42,
|
|
}
|
|
s.ingestAssistantReply(ctx, record, "# 任务终态\n\n结构化说明足够长。", "completed")
|
|
items, err := reg.LoadRequested(ctx)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(items) == 0 {
|
|
t.Fatal("expected assistant reply to be requested in FAV registry")
|
|
}
|
|
if items[0].ArtifactType != artifactvault.TypeAssistantReply {
|
|
t.Fatalf("type=%s", items[0].ArtifactType)
|
|
}
|
|
}
|