Created session/mount.go with all 9P FUSE mount logic previously in core.
Changes:
- New session/mount.go with MountPathFor(), WithMount9P(), and mount lifecycle functions
- WithMount9P() returns execute.Option that wires up OnEnvSet, OnPreDispatch, OnClose hooks
- Updated session.go to use WithMount9P() and MountPathFor() instead of execute.WithMount() and execute.MountPath()
- Mount logic encapsulated in mountState struct with proper synchronization
The mount implementation is now fully contained in the 9p module.
- Wire ReadPlanStep directly from sess.plan (no filesystem read)
- Add ListHandlers to ManagerConfig; passed through to AgentCoreConfig
- Hoist skillTree in main.go; populate ListHandlers for tools+skills
- Add ListHandlers to ManagerConfig
- Add ModelCache that prefetches models from all backends at startup
- Cache models in memory, refresh on demand via Invalidate()
- Add global /ctl file with 'invalidate' command
- Add 'invalidate' ctl command and /invalidate slash command in sessions
- Fix filePerm to query rootStore for root-level file permissions
- Add 'models' to root directory listing
- NewSession subscribes to bus "event" topic for chat log writing
- Remove makePublish/handler threading from all Submit call sites
- Adapt tests to new bus-based event delivery
p9File.Getattr was hardcoding 0666 for all files, breaking
permission visibility in per-session mounts. Use the actual
mode from the 9P stat response instead.
Remove hardcoded permission switch in makeStat and delegate to
the underlying FileTree.Stat() instead. This makes FileList in
sessionfile.go the single source of truth for session file modes.
- server.New takes server.Config (no more internal construction)
- OnRename removed: wstat handles all fid rewriting directly
- WithStrict/WithYolo removed (passed via ManagerConfig)
- Default dir functions moved to main.go
- tool.go and root.go in main package (wiring)
- Server is now a pure protocol handler
- session.go, sessionfile.go: moved to main package (lifecycle)
- store/tool.go, store/root.go: store constructors where they belong
- main_test.go: session tests in main package
- store/store_test.go: only store-level tests remain
- Removed: root.go, tools.go from main (moved to store/)
- Clean separation: store/ = abstraction, main = domain
DirStore.ListDir now uses listDirFn when set.
SessionManager wires ListDir through the hook so
session subdirectory listing works via the DirStore view.
OnRename callback already rewrites fid paths, so by the time
wstat's fid update runs, f.path has changed. Use relPath for
the new path computation instead of slicing f.path.
SessionManager no longer embeds *DirStore. Instead:
- SessionManager.Store() returns the DirStore view
- Server uses mgr.Store() in route table, mgr for lifecycle
- DirStore gains WithStat hook for custom stat logic
- Removed: RunnableStore interface, storeConfig type
- Tests updated to use .Store() for store operations