# v0.6.0 Release Notes

> v0.5.0 -> v0.6.0

## Summary

Introduces a summary-based persistent memory system that compresses conversation state into structured JSON and injects it across sessions, enabling the agent to recall prior conclusions without replaying full history. Includes a centralized config path utility and refactors scattered path construction logic.

<details>
<summary>翻譯</summary>
新增概要式持久記憶機制，將對話狀態壓縮為結構化 JSON 並跨 Session 注入，使 Agent 無需重播完整歷史即可引用先前結論。同時抽離集中式配置路徑工具，重構散落各處的路徑組合邏輯。
</details>

## Changes

### FEAT
- Add summary-based persistent memory: agent outputs structured JSON summary (`<!--SUMMARY_START-->`...`<!--SUMMARY_END-->`) at end of each response; summary is parsed, stored as `summary.json`, and injected into subsequent sessions via `summaryPrompt.md`
- Add session history persistence: conversation turns (excluding tool-call messages) saved to `history.json`; last 4 non-tool turns replayed per request to bound context size
- Add `utils.ConfigDir()` helper returning `ConfigDirData{Home, Work}` with auto-`MkdirAll`, replacing scattered `os.UserHomeDir()` / `filepath.Join` calls across the codebase
- Inject current datetime into user message at call time rather than baking it into the static system prompt template
- Add tool action logging: each tool execution (including user-skipped ones) is recorded with tool name and result, saved to `{configDir.Work}/{sessionID}/{timestamp}.json`

<details>
<summary>翻譯</summary>

- 新增概要式持久記憶：Agent 每次回應結尾輸出結構化 JSON 摘要，解析後儲存為 `summary.json`，並透過 `summaryPrompt.md` 注入後續 Session
- 新增 Session 歷史持久化：非 tool-call 的對話輪次儲存至 `history.json`；每次請求重播最近 4 輪，限制 Context 膨脹
- 新增 `utils.ConfigDir()` 輔助函式，回傳含 `Home`、`Work` 的 `ConfigDirData` 並自動 `MkdirAll`，取代散落各處的路徑組合邏輯
- 將當前時間注入至 user message，移除 system prompt 模板中的 `{{.Date}}` 佔位符
- 新增 Tool Action 記錄：每次工具執行（含使用者跳過）均記錄工具名稱與結果，儲存至 `{configDir.Work}/{sessionID}/{timestamp}.json`

</details>

### REFACTOR
- Replace manual `os.UserHomeDir()` + `filepath.Join` with `utils.ConfigDir()` in `copilot/new.go`, `browser/load.go`, and `tools/executor.go`
- Fix `executor.go` API toolbox loading: correctly loads from both `configDir.Home` and `configDir.Work`

<details>
<summary>翻譯</summary>

- 在 `copilot/new.go`、`browser/load.go`、`tools/executor.go` 中以 `utils.ConfigDir()` 取代手動路徑組合
- 修正 `executor.go` API Toolbox 載入邏輯：正確同時載入 `configDir.Home` 與 `configDir.Work`

</details>

***

## Files Changed

| File | Status | Tag |
|------|--------|-----|
| `internal/agents/exec.go` | Modified | FEAT |
| `internal/utils/utils.go` | Modified | FEAT |
| `internal/agents/prompt/summaryPrompt.md` | Added | FEAT |
| `internal/agents/prompt/sysPrompt.md` | Modified | FEAT |
| `internal/agents/prompt/sysPromptBase.md` | Modified | FEAT |
| `internal/agents/provider/copilot/new.go` | Modified | REFACTOR |
| `internal/tools/browser/load.go` | Modified | REFACTOR |
| `internal/tools/executor.go` | Modified | REFACTOR |
| `doc.md` | Modified | DOC |
| `doc.zh.md` | Modified | DOC |
| `internal/agents/provider/copilot/login.go` | Modified | STYLE |
| `internal/tools/apiAdapter/execute.go` | Modified | STYLE |
| `internal/tools/apiAdapter/send.go` | Modified | STYLE |
| `internal/skill/scanner.go` | Modified | STYLE |
| `cmd/cli/main.go` | Modified | STYLE |

***

Generated by [SKILL](https://github.com/pardnchiu/skill-version-generate)
