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

+6
View File
@@ -98,6 +98,11 @@ export const AgentRuntimeSettings = z.object({
.max(24 * 30),
/** fake 模式脚本(JSON,FakeScript 的可序列化子集);null 用内置演示脚本 */
fakeScript: z.string().max(100_000).nullable(),
/**
* Agent JSONL 会话目录(绝对路径,api 与 worker 进程都要能读写);
* null = 部署默认(环境变量 AGENT_SESSION_DIR,缺省 DATA_DIR/agent-sessions)
*/
sessionDir: z.string().max(1024).regex(/^\//, "必须是绝对路径").nullable(),
});
export type AgentRuntimeSettings = z.infer<typeof AgentRuntimeSettings>;
@@ -168,6 +173,7 @@ export const DEFAULT_SETTINGS: GlobalSettings = {
goalPollSec: 60,
goalWaitHours: 72,
fakeScript: null,
sessionDir: null,
},
metadata: { tmdbApiKeySecretRef: null, tmdbBaseUrl: null },
};