ARTEX-English/agent/worker_intervention_test.go
Sean Kilfoy edaf7e323a Package BaaRai v0.7.0 as the operator distribution.
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.
2026-11-26 07:33:09 +00:00

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")
}
}