From 4643c4fca5bf0bc657c99a7e0512711033244d10 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Wed, 29 Jul 2026 20:27:23 +0200 Subject: [PATCH] =?UTF-8?q?session:=20rename=20Agent.uname=20=E2=86=92=20A?= =?UTF-8?q?gent.id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The agent's identity field is its id, not a Unix username. Config.Uname preserved as public API (renamed with 9P recraft). --- session/agent.go | 2 +- session/commands.go | 2 +- session/session.go | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/session/agent.go b/session/agent.go index 65e9e20..7f7be68 100644 --- a/session/agent.go +++ b/session/agent.go @@ -31,7 +31,7 @@ type Agent struct { state string // "idle", "thinking", "calling: " reply string // last assistant response cwd string // working directory for tool execution - uname string // agent principal (numeric UID for 9P identity) + id string // agent identity (unique principal) fifo Fifo // prompt queue toolCallCount atomic.Int64 pendingInject atomic.Pointer[string] diff --git a/session/commands.go b/session/commands.go index dad9bb9..c51463a 100644 --- a/session/commands.go +++ b/session/commands.go @@ -175,7 +175,7 @@ func (a *Session) handleCommand(ctx context.Context, input string) bool { return } d := a.r.newDispatcher() - env := []string{"OLLIE_SESSION_ID=" + a.id, "OLLIE_UNAME=" + a.r.uname} + env := []string{"OLLIE_SESSION_ID=" + a.id, "OLLIE_UNAME=" + a.r.id} env = append(env, a.r.promptEnvExtra...) rt := BuildRuntime(cfg, d, a.r.cwd, env, a.r.baseLayers...) if rt.CfgBackend != "" { diff --git a/session/session.go b/session/session.go index 9aaf518..b093a45 100644 --- a/session/session.go +++ b/session/session.go @@ -365,8 +365,8 @@ func (a *Session) pushSessionEnv() { if srv, ok := a.r.runtime.Dispatcher.GetServer("execute"); ok { if es, ok := srv.(tools.EnvSetter); ok { es.SetEnv("OLLIE_SESSION_ID", a.id) - if a.r.uname != "" { - es.SetEnv("OLLIE_UNAME", a.r.uname) + if a.r.id != "" { + es.SetEnv("OLLIE_UNAME", a.r.id) } } } @@ -464,6 +464,7 @@ func New(cfg Config) *Session { history: cfg.History, runtime: rt, cwd: paths.ExpandHome(cfg.CWD), + id: cfg.Uname, agentName: cfg.AgentName, agentsDir: cfg.AgentsDir, promptEnvExtra: cfg.PromptEnvExtra,