feat(settings): agent.sessionDir setting shown on settings page

null keeps the deployment default (AGENT_SESSION_DIR / DATA_DIR/agent-sessions).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-27 22:15:43 +08:00
1 parent f9c20c67dc
commit f6457a29db
3 files changed
+26 -3

No files matched your search

@@ -247,6 +247,14 @@ const AGENT_RUNTIME_CARD: CardSpec = {
kind: "textarea",
hint: '{"match":"收进来","steps":[{"toolCalls":[{"capability":"inventory.query","input":{"query":"沙丘2"}}]}],"finalText":"…"},格式见 docs/runbook/agent.md',
},
{
name: "agent.sessionDir",
label: "会话目录",
kind: "text",
wide: true,
placeholder: "留空用部署默认:DATA_DIR/agent-sessions(容器内 /data/agent-sessions)",
hint: "绝对路径,api 与 worker 进程都要可读写;有运行中的会话时不要改(续跑会找不到旧会话文件)",
},
],
fromSettings: (s) => ({
"agent.maxToolCalls": n(s.agent.maxToolCalls),
@@ -256,6 +264,7 @@ const AGENT_RUNTIME_CARD: CardSpec = {
"agent.goalPollSec": n(s.agent.goalPollSec),
"agent.goalWaitHours": n(s.agent.goalWaitHours),
"agent.fakeScript": s.agent.fakeScript ?? "",
"agent.sessionDir": s.agent.sessionDir ?? "",
}),
toPatch: (v) => ({
agent: {
@@ -266,6 +275,7 @@ const AGENT_RUNTIME_CARD: CardSpec = {
goalPollSec: num(v["agent.goalPollSec"]),
goalWaitHours: num(v["agent.goalWaitHours"]),
fakeScript: str(v["agent.fakeScript"]).trim() || null,
sessionDir: str(v["agent.sessionDir"]).trim() || null,
},
}),
};