Documentation v0.28.0

v0.19.9 -> v0.20.0

Summary

Session lifecycle adds a friendly-name layer plus three routing prefixes: subagent name dispatch, :<name> one-shot CLI prefix, and skill-arg pass-through. Runtime gains a UID/PID singleton with per-session state tracking. go-utils upgraded to v0.9.4.

翻譯 Session 生命週期加入友善名稱層與三條路由:subagent name 分派、`:` CLI one-shot 前綴、skill 前綴 args 透傳。Runtime 新增 UID/PID singleton 與 per-session 狀態軌跡。go-utils 升級至 v0.9.4。

Changes

FEAT

翻譯
  • internal/session/match.go 新增 session.Match(input) (name, effective) 解析 :bot ship v0.20 前綴;exec.Run 最外層先解析(早於 MatchExternalMatchSkillCall),��中時 GetSessionIDByName 解析 sid 後寫入 ExecData.SessionID、effective 文字往下派;getSession.go 偵測 SessionID != "" 走 override 早期分支(IsDir 驗證 → 載入 history/summary/system prompt → 寫 user message/DBSessionHist),讀寫 filesystem.ConfigPath 保留全域 cli 指標。Composable::bot /commit-generate v0.20 順序為 session resolve → skill match。範圍 CLI/TUI only(HTTP 已有 body session_id、Discord 走 dc- per-channel)。前綴選擇 :@ 撞 agent 檔案 reference 慣例、$ 是 shell metachar 雙引號內被展開,: 不是 shell metachar、無 agent 慣例
  • Skill 前綴路由(MatchSkillCall)對 /skill-name <args> 回傳 args tail 作為 user message(無 args 時 fallback 為完整 trimmed);skill_execution.md 新增 Mandatory Principle #5「The user message carrying this skill activation is binding context, not noise」與 Execution Flow step 2 (capture user input) /step 5 (visibly reflect user context),強制 LLM 把使用者文字編進 skill 輸出(version target/scope hint/tone 等),SKILL.md 描述 default behavior,使用者文字 override/augment default
  • invoke_subagent 新增 name 參數(透過 session.GetSessionIDByNamecli-*http-* 的 bot.md frontmatter 解析為 sid,未命中即 error),優先級高於 session_idask_user handler 入口加 cli-* prefix gate,非 cli- session 回傳格式化引導訊息要求 LLM 改以回覆文字向使用者問問題;system_prompt.md 新增「轉派具名 helper」forced-routing entry 涵蓋「呼叫 X 來 Y」「請 X 處理 Y」等中英自然語句;http- session 從 CleanupSessions 白名單移除(語意對齊 persist=true → 永久保留)
  • agen new [name] 建立 cli- session 並切換主指標(衝突檢查走 frontmatter name 字面相等);agen switch <name> 依 name 切換主指標;agen config 開啟 $EDITOR 編輯當前 CLI session 的 bot.md;makefile 對應加入 make newmake switchmake config targets
  • 每個 session 在建立目錄時冪等寫入 bot.md(YAML frontmatter name,預設等於 sessionID;body 為 configs/prompts/default_session_prompt.md embed),SaveBot(sessionID, name, force) 控制是否覆寫;system prompt 新增 {{.BotPersona}} 佔位於最頂端(exec.GetSystemPrompt 末參新增 sessionID 用於補建與讀取);internal/session/bot.go 提供 SaveBotGetBotGetSessionIDByName 共用 helper

UPDATE

翻譯
  • 升級 github.com/pardnchiu/go-utils 至 v0.9.4;internal/session/actionLog.gointernal/agents/exec/execute.go 的 tool event 寫入時序與訊息收斂;fetchPagerunEvents 同步調整以對齊新版 utils API

ADD

翻譯
  • internal/runtime:新增 runtime.uid singleton 控制檔({uid, pid, started_at}),runApp 啟動時 SIGTERM(5s) → SIGKILL 取代既有 server process;CLI/run 路徑只讀不寫;新增 IsAliveIsCurrent PID liveness check;internal/session/status.go:新增 status.jsonstate + active []Task + ended_at),Online(sid, input) 回傳 task UUID 並 push、Idle(sid, taskID) 移除指定 task、空 active 即降為 idle,外部 reader 可 GET /v1/session/:id/statusinternal/session/actionLog.go:新增 action.log append-only 軌跡(AppendActionUserInputRecord,1MB rotate 至 768KB headroom,按 \n 對齊),GET /v1/session/:id/log SSE 串流尾端 100 行;runApp 啟動清理串聯 runtime.InitCleanupSessionstemp-* 1h idle)→ ClearAllActive;CLI/run 路徑進場以 runtime.IsCurrent() 判斷是否清理該 session 的 stale active 任務

Scope


Generated by SKILL