Files
Agent-System-Backend/internal/runmgr/hitl_timeout_test.go
T
weichenandCursor cd5b82186d Add the public extension surface and platform services
Why: Downstream products must extend the base through a public package and host API instead of editing internal code.
Evidence: go test ./... passed, including plugin v2 assets, sidecar startup, migration v13, pending confirms, HITL timeout, hash embedder, command pairs, and the extension surface snapshot.
Impact: apiVersion 2.0-experimental rejects empty network allowlists for declarative HTTP. Hash embeddings stay opt-in via models.embedding.provider=hash. Plugin secrets resolve per owner at execution time.
Refs: docs/proposals/2026-10-01-plugin-contract-v2.md
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-01 10:35:02 +00:00

28 lines
610 B
Go

package runmgr
import (
"context"
"strings"
"testing"
"time"
core "agent-system-core"
)
func TestWaitHITLTimeout(t *testing.T) {
ch := make(chan hitlAnswer)
_, err := waitHITL(context.Background(), ch, 20*time.Millisecond)
if err == nil || !strings.Contains(err.Error(), "timed out") {
t.Fatalf("got %v", err)
}
}
func TestWaitHITLAnswer(t *testing.T) {
ch := make(chan hitlAnswer, 1)
ch <- hitlAnswer{resp: core.HITLResponse{ChoiceID: "ok"}}
resp, err := waitHITL(context.Background(), ch, time.Second)
if err != nil || resp.ChoiceID != "ok" {
t.Fatalf("resp=%+v err=%v", resp, err)
}
}