Clarify system prompt variable evaluation timing

This commit is contained in:
7Sageer 2026-07-30 18:21:47 +08:00
parent fa8cd4ce58
commit 70ed1542e3
2 changed files with 4 additions and 0 deletions

View file

@ -158,6 +158,8 @@ Like the body of a regular agent file, SYSTEM.md is rendered as a template each
Unknown variables stay verbatim, a bare `$` is never special, and a variable with no context value renders as an empty string. Three pre-composed blocks — `${windows_notes}`, `${additional_dirs_section}`, and `${skills_section}` — render the matching built-in prompt section, or an empty string when it does not apply. The variables are enough to rebuild the skeleton of the built-in prompt, for example:
These variables are evaluated when the system prompt is rendered. An existing session does not watch `AGENTS.md` or inject a change reminder automatically; edits take effect the next time the system prompt is rendered, such as after a working-directory change, context compaction, or a new session.
```markdown
You are Kimi, running at ${cwd} on ${os}.

View file

@ -158,6 +158,8 @@ SYSTEM.md 是纯 Markdown 正文,不需要也不读取 Frontmatter。文件缺
未知变量原样保留,单独的 `$` 没有特殊含义;上下文中缺失的变量渲染为空字符串。另有三个预组合块——`${windows_notes}``${additional_dirs_section}``${skills_section}`——渲染对应的内置提示词段落,不适用时为空字符串。利用这些变量可以重建内置提示词的骨架,例如:
这些变量会在系统提示词重新构建时求值。现有会话不会监控 `AGENTS.md`,也不会自动注入变更提醒;编辑文件后,需要等系统提示词再次构建(例如切换工作目录、上下文压缩或启动新会话)才会生效。
```markdown
You are Kimi, running at ${cwd} on ${os}.