diff --git a/demos/agent-secret/main.go b/demos/agent-secret/main.go index 62ce52634..56d4e0d25 100644 --- a/demos/agent-secret/main.go +++ b/demos/agent-secret/main.go @@ -57,10 +57,8 @@ func main() { } func handleRequest(w http.ResponseWriter, r *http.Request) { - log.Printf("DEBUG: Request received. Path=%s Host=%s", r.URL.Path, r.Host) - - // 1. Identify Actor (Robust extraction) - // New architecture uses Host: .actors.resources.substrate.k8s.io + // 1. Identify Actor + // Host: .actors.resources.substrate.ate.dev actorID := r.Header.Get("X-AgentSet-Session") if actorID == "" { actorID = r.Header.Get("x-agentset-session") @@ -70,7 +68,7 @@ func handleRequest(w http.ResponseWriter, r *http.Request) { if host == "" { host = r.Header.Get("Host") } - // Extract prefix from .actors.resources.substrate.k8s.io + // Extract prefix from .actors.resources.substrate.ate.dev parts := strings.Split(host, ".") if len(parts) > 1 { actorID = parts[0] @@ -81,23 +79,15 @@ func handleRequest(w http.ResponseWriter, r *http.Request) { actorID = "unknown" } - log.Printf("DEBUG: Identified ActorID: [%s]", actorID) - body, _ := io.ReadAll(r.Body) message := string(body) if message == "" { message = "Status Check" } - // 1. Respond to user + // 2. Respond var sb strings.Builder sb.WriteString(fmt.Sprintf("Agent Response: [%s] | Identity: %s | Session: %s\n", message, residentSecret, actorID)) - if actorID == "" { - sb.WriteString("DEBUG: ID Missing. Headers received:\n") - for k, v := range r.Header { - sb.WriteString(fmt.Sprintf(" %s: %v\n", k, v)) - } - } response := sb.String() w.Header().Set("Content-Type", "text/plain") w.WriteHeader(http.StatusOK)