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 <noreply@anthropic.com>
This commit is contained in:
Levi Neely 2026-04-11 14:21:37 +02:00
parent cf777b9420
commit 071add996c
1 changed files with 4 additions and 0 deletions

View File

@ -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()