diff --git a/cmd/ollie-remote/main.go b/cmd/ollie-remote/main.go index 4a58575..7dd34b4 100644 --- a/cmd/ollie-remote/main.go +++ b/cmd/ollie-remote/main.go @@ -52,7 +52,13 @@ func main() { // Build the tool server with tool registry. toolReg, _ := toolsrv.NewRegistry() - agentID := fmt.Sprintf("agent-%d", os.Getpid()) + // The session's immutable ID is required for tool registry scoping and + // elevate broker identity. Set by the parent process (olliesrv or SSH bootstrap). + agentID := os.Getenv("OLLIE_SESSION_ID") + if agentID == "" { + fmt.Fprintln(os.Stderr, "OLLIE_SESSION_ID not set") + os.Exit(1) + } var opts []toolsrv.Option if *yolo {