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.
This commit is contained in:
parent
c05f4d1ef0
commit
2561e01574
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Reference in New Issue