From 071add996c2a43d709d923c890299b2bde23d80e Mon Sep 17 00:00:00 2001 From: Levi Neely Date: Sat, 11 Apr 2026 14:21:37 +0200 Subject: [PATCH] p9: wire SetWorkDir into workdir write handler Validate the path and propagate the change to the agent core (which updates the execute server and rebuilds the system prompt) before updating the session's cached workdir field. Return early on error. Co-Authored-By: Claude Sonnet 4.6 --- internal/p9/server.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/p9/server.go b/internal/p9/server.go index 3825976..cba9d96 100644 --- a/internal/p9/server.go +++ b/internal/p9/server.go @@ -767,6 +767,10 @@ func (s *Server) handleWrite(path, input string) { }) case "workdir": + if err := sess.core.SetWorkDir(input); err != nil { + fmt.Fprintf(os.Stderr, "olliesrv: workdir: %v\n", err) + return + } sess.mu.Lock() sess.workdir = input sess.mu.Unlock()