From 2561e0157432ccd564cc21a92e9d6625b8ea727a Mon Sep 17 00:00:00 2001 From: Ollie Agent Date: Sun, 9 Aug 2026 02:47:26 +0200 Subject: [PATCH] fs: move per-agent models to ctl command, remove models file /models now lists available models for the agent's backend via ctl. One fewer file in the agent namespace. The root-level models file (all backends) remains unchanged. --- data/scripts/o | 2 +- fs/handlers.go | 6 ++---- fs/spec.go | 5 ----- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/data/scripts/o b/data/scripts/o index 8f5a211..e6db6e5 100755 --- a/data/scripts/o +++ b/data/scripts/o @@ -33,7 +33,7 @@ ROOT_ENTRIES="session bypass agents backends models help ctl eventwait complete SESSION_FILES="env paused connected ctl name id bypass" # Agent-level files (exist under session/{name}/agent/{name}/) -AGENT_FILES="prompt fifo chat chat.raw statewait log plan cfg ctl cwd stats models systemprompt tools name id proc" +AGENT_FILES="prompt fifo chat chat.raw statewait log plan cfg ctl cwd stats systemprompt tools name id proc" is_root_path() { local path="$1" diff --git a/fs/handlers.go b/fs/handlers.go index 6075cf4..79d5a6b 100644 --- a/fs/handlers.go +++ b/fs/handlers.go @@ -710,6 +710,8 @@ func requestAgentCtl(ctx HandlerCtx, data []byte) ([]byte, error) { be.SetModel(strings.Join(args, " ")) } return []byte(strings.Join(args, " ") + "\n"), nil + case "models": + return []byte(ctx.Session.CachedListModels() + "\n"), nil case "backend": if len(args) == 0 { if be := ctx.Agent.Backend(); be != nil { @@ -760,10 +762,6 @@ func readAgentStats(ctx HandlerCtx) ([]byte, error) { return []byte(s), nil } -func readAgentModels(ctx HandlerCtx) ([]byte, error) { - return []byte(ctx.Session.CachedListModels() + "\n"), nil -} - func readAgentSystemprompt(ctx HandlerCtx) ([]byte, error) { return []byte(ctx.Agent.SystemPrompt() + "\n"), nil } diff --git a/fs/spec.go b/fs/spec.go index fed6616..2539f90 100644 --- a/fs/spec.go +++ b/fs/spec.go @@ -280,11 +280,6 @@ FileNode("generate", 0666, Read(readAgentStats), ), - FileNode("models", 0444, - Doc("Available models for this agent's backend."), - Read(readAgentModels), - ), - FileNode("systemprompt", 0444, Doc("Fully rendered system prompt for this agent."), Read(readAgentSystemprompt),