From aedfdec564cca190f5373ae688a8f9e02dd20b67 Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Wed, 12 Aug 2026 11:08:37 +0200 Subject: [PATCH] fix: set agent ID on tool server after /agent switch SwitchProfile creates a new tool server connection but wasn't calling SetAgentID on it, causing 'agent ID required' errors when listing tools. --- cmd/olliesrv/internal/agent/agent.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/olliesrv/internal/agent/agent.go b/cmd/olliesrv/internal/agent/agent.go index 510a113..b94f4c2 100644 --- a/cmd/olliesrv/internal/agent/agent.go +++ b/cmd/olliesrv/internal/agent/agent.go @@ -359,6 +359,9 @@ func (ag *Agent) SwitchProfile(name string) error { return fmt.Errorf("agent %q: %w", name, err) } disp := ag.newToolServer() + if disp != nil && ag.id != "" { + disp.SetAgentID(ag.id) + } env := []string{"OLLIE_SESSION_ID=" + ag.sessionID, "OLLIE_UNAME=" + ag.id} rt := BuildRuntime(cfg, disp, ag.cwd, env, ag.systemPrompt, ag.envBlock) if cfg.Backend != "" {