Files
deepseek-harness/packages/preset/README.zh.md
Yichen Jiang 739042a804 feat(persona): make the agent persona a composable row
`dsh-system-prompt` owns the deployment persona as its own config and registers
that section unconditionally, so a process has exactly one. An agent preset
cannot mount the prompt registry itself, which means that without a row of its
own a preset could change an agent's tools but never its identity — and a
roster of presets that all sound the same is not worth having.

The row is scope-only by construction: mounted outside an agent scope it
collides with the registry's own `deployment:persona` registration and fails
loud. That is the correct shape rather than a gap, because the unscoped slot
already has an owner and this row exists to shadow it for one agent.

Two behaviours are pinned by test because both read the other way at a glance:
an empty persona still occupies the slot (shadowing the deployment persona away
entirely, then disappearing at render), and `assemble()` keeps section text
uninterpolated — `renderPrompt()` is the stage that resolves `{{…}}`.
2026-08-07 00:35:30 +08:00

1.1 KiB
Raw Blame History

preset/:按会话组装 agent

English | 中文

agent preset 是一个目录,其中放置一份 agent.cordis.yml。把它挂载到某个 agent智能体的 scope 上下文之下,该会话就获得自己的工具与提示词段落,而其他在运行的会话各自保持不变,因此一个进程可以同时运行多个组装方式不同的 agent。

职责 ctx 键
agent-presets/ preset 词汇、在受信任目录与用户自建目录上的文件系统发现,以及带校验的按 agent 挂载 ctx.agentPresets
persona/ 把 agent 人设做成可组装的行,使 preset 不止能改工具、也能改身份

本组假定的组装划分是注册表与跨会话设施是进程单例留在宿主组装中preset 只承载单个 agent 对它们的贡献。若 preset 中某一行发布了进程级全局服务,挂载时即被拒绝,而不是留到与下一个会话相撞。

设计详见 按会话组装 agent preset 的 Agent Note