9p: remove file and reasoning server registrations; session tmpdir init

- Remove file.Decl and reasoning.Decl from dispatcher
- go mod tidy: drop go-udiff dependency
- Initialize /tmp/ollie/$sessID on session create (rm -rf + mkdir)
- Rename /tmp/ollie/$oldID -> $newID on session rename

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Levi Neely 2026-04-14 15:26:23 +02:00
parent f5c0b29522
commit acaaef9971
3 changed files with 13 additions and 10 deletions

5
go.mod
View File

@ -7,9 +7,6 @@ require (
ollie v0.0.0-00010101000000-000000000000
)
require (
github.com/aymanbagabas/go-udiff v0.4.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
require gopkg.in/yaml.v3 v3.0.1 // indirect
replace ollie => ../core

2
go.sum
View File

@ -2,8 +2,6 @@
9fans.net/go v0.0.7/go.mod h1:Rxvbbc1e+1TyGMjAvLthGTyO97t+6JMQ6ly+Lcs9Uf0=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/aymanbagabas/go-udiff v0.4.1 h1:OEIrQ8maEeDBXQDoGCbbTTXYJMYRCRO1fnodZ12Gv5o=
github.com/aymanbagabas/go-udiff v0.4.1/go.mod h1:0L9PGwj20lrtmEMeyw4WKJ/TMyDtvAoK9bf2u/mNo3w=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=

View File

@ -50,8 +50,6 @@ import (
"ollie/pkg/skills"
"ollie/pkg/tools"
"ollie/pkg/tools/execute"
"ollie/pkg/tools/file"
"ollie/pkg/tools/reasoning"
)
const (
@ -972,6 +970,13 @@ func (s *Server) renameSession(oldID, newID string) error {
c.mu.Unlock()
}
// Rename the session tmpdir so isread markers remain valid.
oldTemp := "/tmp/ollie/" + oldID
newTemp := "/tmp/ollie/" + newID
if _, err := os.Stat(oldTemp); err == nil {
os.Rename(oldTemp, newTemp) //nolint:errcheck
}
sess.appendChat([]byte(fmt.Sprintf("(session renamed: %s -> %s)\n", oldID, newID)))
fmt.Fprintf(os.Stderr, "olliesrv: renamed session %s -> %s\n", oldID, newID)
return nil
@ -1308,8 +1313,6 @@ func (s *Server) createSession(args []string) error {
newDisp := tools.NewDispatcherFunc(map[string]func() tools.Server{
"execute": execute.Decl(cwd),
"file": file.Decl(cwd),
"reasoning": reasoning.Decl(),
})
sessID := name
@ -1324,6 +1327,11 @@ func (s *Server) createSession(args []string) error {
return fmt.Errorf("session already exists: %s", sessID)
}
// Initialize clean tmpdir for this session.
sessTemp := "/tmp/ollie/" + sessID
os.RemoveAll(sessTemp) //nolint:errcheck
os.MkdirAll(sessTemp, 0700) //nolint:errcheck
env := agent.BuildAgentEnv(cfg, newDisp(), cwd)
// Inject per-session env vars into the execute server.