# v1.3.9 Release Notes

> v1.3.8 -> v1.3.9

## Summary

Unattended API runs now default to read-only inside the sandbox, with explicit opt-ins for edits and leaving the sandbox, and the send endpoint gains clearer parameter names while keeping the old ones working. A one-shot prompt command returns on top of the same endpoint, and canceled tasks stay in chat history instead of disappearing.

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

無人值守的 API 執行改為預設唯讀且留在沙箱內，寫入與離開沙箱需明確開啟；send 端點改用更清楚的參數名稱，舊名稱仍可使用。單次 prompt 指令以同一端點重新提供，手動取消的任務改為保留在對話歷史中，不再消失。

</details>

## Changes

### FEAT

- Add auto mode to `/v1/send`: requests that set `enable_edit` or `enable_sandbox`, or that run with no web confirm listener, never prompt; they are read-only unless `enable_edit: true` (writes and non-read-only commands), stay in the sandbox unless `enable_sandbox: false` (paths outside `$HOME`, `sudo`, `sandbox: false`), exclude `ask_user`, `store_secret` and background tools, reject blocked calls with the flag that would allow them, and clear the session's path grants at the start of each request (@pardnchiu) [4ad4a044]
- Add `/v1/send` parameters `stream`, `rule` and `task_hash`; the old `sse`, `system_prompt` and `pending_task` are still accepted and marked for deprecation, and the web UI sends the new names (@pardnchiu) [4ad4a044]
- Bring back one-shot runs as `agen -p <prompt>`, replacing the earlier `agen run` / `run-allow`: it calls `/v1/send` (starting the daemon when needed), takes `-m/--model`, `-r/--reasoning`, `--stream`, `--work-dir` (default: current directory), `--allow-edit` and `--skip-sandbox`, reads the prompt from stdin when `-p` is empty, prints model, tool and thinking lines (`⏵ Model(...)`, `⏵ Tool(...)`, `✻ ...`) to stderr while streaming and the reply to stdout, and exits 1 on errors and 130 on cancel (@pardnchiu) [bb41de42]
- Add `enable_markdown` to `/v1/send` (default `true`); `false` asks the model to reply in plain text without markdown syntax (@pardnchiu) [bb41de42]

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

- `/v1/send` 新增 auto mode：帶 `enable_edit` 或 `enable_sandbox`，或沒有網頁確認 listener 時一律不跳確認；未設 `enable_edit: true` 時唯讀（擋寫入與非唯讀指令），未設 `enable_sandbox: false` 時留在沙箱內（擋 `$HOME` 外路徑、`sudo`、`sandbox: false`）；排除 `ask_user`、`store_secret` 與背景工具，被擋的呼叫回傳可放行的參數，每次請求開始時清除該 session 的路徑授權
- `/v1/send` 新增參數 `stream`、`rule`、`task_hash`；舊的 `sse`、`system_prompt`、`pending_task` 仍可使用並標為即將棄用，網頁改送新參數
- 以 `agen -p <prompt>` 補回單次執行，取代舊版 `agen run`／`run-allow`：呼叫 `/v1/send`（必要時自動啟動 daemon），支援 `-m/--model`、`-r/--reasoning`、`--stream`、`--work-dir`（預設當前目錄）、`--allow-edit`、`--skip-sandbox`；`-p` 為空時讀 stdin；串流時 model、工具與 thinking（`⏵ Model(...)`、`⏵ Tool(...)`、`✻ ...`）印到 stderr，回覆印到 stdout；錯誤 exit 1、取消 exit 130
- `/v1/send` 新增 `enable_markdown`（預設 `true`）；設為 `false` 時要求模型以不含 markdown 語法的純文字回覆

</details>

### FIX

- Keep tasks canceled by the user in chat history with a `[Canceled]` reply, including the last error when the task had failed, instead of deleting them; canceling a background job no longer removes a parent task that is still running (@pardnchiu) [ee1a22dc]
- Prefix replies from a send that failed with no fallback model with `[Saved to /pending]:` (@pardnchiu) [ee1a22dc]
- Recreate a session directory on save when its database row already exists (@pardnchiu) [ee1a22dc]
- Return the error text in stream error events, which were previously sent with empty text (@pardnchiu) [4ad4a044]

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

- 使用者手動取消的任務改為以 `[Canceled]` 回覆保留在對話歷史中（任務原本失敗時附上最後的錯誤），不再刪除；取消背景 job 時不再移除仍在執行的母任務
- 送出失敗且無備援模型時，回覆加上 `[Saved to /pending]:` 前綴
- session 的資料庫列已存在時，儲存仍會重建 session 目錄
- 串流的錯誤事件改為帶出錯誤文字，原本送出的是空字串

</details>

## Scope

- `cmd/app/` — FEAT (`main.go`, `prompt.go`)
- `configs/` — FEAT (`configs.go`, `prompts/system_prompt/component/plain_text.md`)
- `internal/runtime/routes/handler/` — FEAT, FIX, REFACTOR (`send.go`, `sendSSE.go`, `pending.go`, `chatCompletions/run.go`)
- `internal/agents/exec/` — FEAT, FIX, REFACTOR (multiple files)
- `internal/agents/types/` — FEAT (`agent.go`)
- `internal/tools/` — FEAT, FIX (`guide.go`, `interactive/`, `file/boundary/boundary.go`)
- `internal/session/config/bot/` — FIX (`bot.go`)
- `internal/utils/` — UPDATE (`toolFormat.go`)
- `internal/runtime/chatbot/`, `internal/runtime/ipc/`, `internal/app/` — REFACTOR
- `page/` — FEAT (`src/js/_send.js`, `public/index.js`)
- `doc/` — DOC

---

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