ollie-remote: use OLLIE_SESSION_ID for elevate broker identity

ollie-remote was sending 'agent-<pid>' as the session identity to the
elevate broker, which never matches any real session. Now reads
OLLIE_SESSION_ID from inherited environment (set by the parent
olliesrv process) so the broker can validate the session exists.
This commit is contained in:
Levi Neely 2026-08-03 11:05:31 +02:00
parent 45f76c3e01
commit 8aff88d0a1
1 changed files with 7 additions and 1 deletions

View File

@ -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 {