mirror of
https://github.com/skilfoy/ARTEX-English.git
synced 2026-12-03 13:11:02 +00:00
The application tree is BaaRai/ARTEX v0.7.0 (22ae88af), imported as one commit because that history is not in this repository. This commit adds the cloud installer, a defender pack for the console and the known-bad image names, and a supply-chain check. The opt-in update banner points at this fork and stays off in the cloud compose file.
28 lines
870 B
Go
28 lines
870 B
Go
package agent
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/Autumn-27/norma/llm"
|
|
)
|
|
|
|
func TestWorkerSessionIDIsStablePerIntent(t *testing.T) {
|
|
if got := WorkerSessionID(12, 34); got != "exp12-worker-i34" {
|
|
t.Fatalf("session id = %q, want exp12-worker-i34", got)
|
|
}
|
|
}
|
|
|
|
func TestWorkerChatMarkerOnlyMatchesItsNormalUserTurn(t *testing.T) {
|
|
requestID := "worker-message-123"
|
|
messages := []llm.Message{
|
|
{Role: llm.RoleAssistant, Content: []llm.ContentBlock{llm.TextBlock(workerChatMarker(requestID))}},
|
|
llm.UserText(workerChatMarker("worker-message-other") + "\nother"),
|
|
llm.UserText(workerChatMarker(requestID) + "\nnew intent"),
|
|
}
|
|
if !hasWorkerChatMessage(messages, requestID) {
|
|
t.Fatal("expected the matching user turn to be detected")
|
|
}
|
|
if hasWorkerChatMessage(messages, "worker-message-missing") {
|
|
t.Fatal("unrelated request id matched a Worker user turn")
|
|
}
|
|
}
|