fix(core): present the project dir to the model as the App Data Dir in the default system prompt (#61)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Yaowei ZhengandClaude Fable 5 authored and GitHub committed 2026-07-26 15:08:09 +08:00
1 parent 14b5e6384f
commit 816a823b75
24 files changed
+423 -68

No files matched your search

+5 -1
View File
@@ -134,6 +134,8 @@ compaction:
# parameters JSON Schema) for every tool you keep — see Tools & Approval.
```
An existing Agent always runs with its on-disk config verbatim — newer code defaults are never merged in automatically. To adopt the current defaults (for example an updated built-in system prompt), use the settings page's **Restore default configuration** action: like a skill update it overwrites the existing configuration — custom system prompt, tool list, model/compaction settings and MCP Servers — keeping only `name`, `description` and `version`.
### System prompt placeholders
`system_prompt` is the only template with placeholder substitution. Available placeholders:
@@ -146,13 +148,15 @@ compaction:
| `{{PLATFORM}}` | Runtime platform |
| `{{OS_VERSION}}` | Operating system version |
| `{{DATE}}` | Current date |
| `{{PROJECT_DIR}}` | Project directory |
| `{{PROJECT_DIR}}` | App Data Dir: the PenguinHarness app data root (the Project directory) |
| `{{AGENT_ID}}` | Agent id |
| `{{CWD}}` | Workspace path |
| `{{PROVIDER}}` | Model provider group |
| `{{MODEL_ID}}` | Upstream model id |
| `{{SESSION_ID}}` | Session id |
`{{PROJECT_DIR}}` is surfaced to the model as the **App Data Dir**: PenguinHarness's application data root, holding every Agent's data files (`agents/<agent_id>/…`) and the project-level data — deliberately not described as a project or task directory, so the model does not mistake it for the task's working directory (`CWD`).
`agent_state/AGENTS.md` is the developer-editable instruction file, injected via `{{AGENTS_MD}}` and empty by default — it is also the file an optimizer edits most (see [Self-Improvement](/self-improvement)).
## Vault
+5 -1
View File
@@ -134,6 +134,8 @@ compaction:
# 参见「工具与审批」页。
```
既有 Agent 始终按其磁盘上的配置原样运行——更新后的代码默认值不会自动合并。要采用当前默认值(例如更新后的内置系统提示词),可使用设置页的**还原为默认配置**操作:与 Skill 更新同语义,会用当前默认值覆盖现有配置——自定义系统提示词、工具列表、模型/压缩参数与 MCP Server——仅保留 `name`、`description` 与 `version`。
### 系统提示词占位符
`system_prompt` 是唯一进行占位符替换的模板,可用占位符:
@@ -146,13 +148,15 @@ compaction:
| `{{PLATFORM}}` | 运行平台 |
| `{{OS_VERSION}}` | 操作系统版本 |
| `{{DATE}}` | 当前日期 |
| `{{PROJECT_DIR}}` | Project 目录 |
| `{{PROJECT_DIR}}` | App Data Dir:PenguinHarness 应用数据根目录(即 Project 目录) |
| `{{AGENT_ID}}` | Agent id |
| `{{CWD}}` | Workspace 路径 |
| `{{PROVIDER}}` | 模型 provider 分组 |
| `{{MODEL_ID}}` | 上游模型 id |
| `{{SESSION_ID}}` | Session id |
`{{PROJECT_DIR}}` 在提示词中以 **App Data Dir** 名义暴露给模型:PenguinHarness 的应用数据根目录,存放全部 Agent 的数据文件(`agents/<agent_id>/…`)与 Project 级数据——特意不以 Project/任务目录的口径描述,避免模型将其误认为本次任务的工作目录(`CWD`)。
`agent_state/AGENTS.md` 是开发者可编辑的指令文件,经 `{{AGENTS_MD}}` 注入系统提示词,缺省为空——它也是优化器最常改动的文件(见[自我进化](/self-improvement))。
## Vault
+1 -1
View File
@@ -61,7 +61,7 @@ The list page creates and deletes Agents; clicking through opens the `/agents/:a
| Tab | Contents |
| --- | --- |
| Overview | Basic info, plus export / import of Agent State snapshots |
| Overview | Basic info, export / import of Agent State snapshots, and restoring the default configuration (overwrites customizations, keeping only name/description) |
| Prompt | AGENTS.md and system_prompt |
| Runtime | Runtime parameters such as max_turns, model.*, compaction.* |
| Tools | Built-in tool table and MCP server JSON configuration |
+1 -1
View File
@@ -61,7 +61,7 @@ penguin web
| 标签页 | 内容 |
| --- | --- |
| Overview | 基本信息,以及 Agent State 快照的导出 / 导入 |
| Overview | 基本信息、Agent State 快照的导出 / 导入,以及还原为默认配置(覆盖自定义内容,仅保留名称与描述) |
| Prompt | AGENTS.md 与 system_prompt |
| Runtime | max_turns、model.*、compaction.* 等运行参数 |
| Tools | 内置工具表格与 MCP Server 的 JSON 配置 |