Files
Agent-System/internal/coordinator/parse_id_test.go
T
weichenandCursor d4041a4f0c fix(coordinator): use the caller name and reject non-decimal user ids
Ambiguous consult only redirects on low confidence, and the testing template greets the signed-in user instead of a hardcoded name. Session tokens no longer parse as user id 0. Live chat sessions now evict the oldest entry at a hard cap.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-19 09:19:36 +00:00

19 lines
450 B
Go

package coordinator
import "testing"
func TestParseDecimalIDRejectsSessionTokens(t *testing.T) {
if got := parseDecimalID("u_sess_12"); got != 0 {
t.Fatalf("session token parsed as %d", got)
}
if got := parseDecimalID("108abc"); got != 0 {
t.Fatalf("partial decimal parsed as %d", got)
}
if got := parseDecimalID("108"); got != 108 {
t.Fatalf("got %d", got)
}
if got := parseDecimalID(" 0 "); got != 0 {
t.Fatalf("got %d", got)
}
}