@keyou007/agent-bot 0.1.25-alpha.0 → 0.1.25-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +60 -5
- package/README.zh.md +60 -5
- package/config.example.yaml +1 -3
- package/dist/cli/controlProtocol.js.map +1 -1
- package/dist/cli/help.js +14 -0
- package/dist/cli/help.js.map +1 -1
- package/dist/cli.js +32 -0
- package/dist/cli.js.map +1 -1
- package/dist/codex/CodexRuntime.js +15 -5
- package/dist/codex/CodexRuntime.js.map +1 -1
- package/dist/commands/CommandRouter.js +7 -0
- package/dist/commands/CommandRouter.js.map +1 -1
- package/dist/config/SettingsStore.js +341 -0
- package/dist/config/SettingsStore.js.map +1 -0
- package/dist/config/loadConfig.js +1 -2
- package/dist/config/loadConfig.js.map +1 -1
- package/dist/config/schema.js +0 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/console/ConsoleTurnPresenter.js +3 -0
- package/dist/console/ConsoleTurnPresenter.js.map +1 -1
- package/dist/feishu/CardRenderer.js +32 -96
- package/dist/feishu/CardRenderer.js.map +1 -1
- package/dist/feishu/FeishuConnector.js +9 -0
- package/dist/feishu/FeishuConnector.js.map +1 -1
- package/dist/feishu/FeishuMessageClient.js +35 -14
- package/dist/feishu/FeishuMessageClient.js.map +1 -1
- package/dist/feishu/FeishuTurnPresenter.js +36 -23
- package/dist/feishu/FeishuTurnPresenter.js.map +1 -1
- package/dist/feishu/LocalCardImage.js.map +1 -1
- package/dist/feishu/LocalImageMarkdown.js +59 -3
- package/dist/feishu/LocalImageMarkdown.js.map +1 -1
- package/dist/feishu/SettingsCard.js +199 -0
- package/dist/feishu/SettingsCard.js.map +1 -0
- package/dist/index.js +17 -6
- package/dist/index.js.map +1 -1
- package/dist/local-files/TurnPreviewPage.js +8 -4
- package/dist/local-files/TurnPreviewPage.js.map +1 -1
- package/dist/presentation/TurnStateReducer.js +21 -2
- package/dist/presentation/TurnStateReducer.js.map +1 -1
- package/dist/presentation/turnStatus.js +34 -0
- package/dist/presentation/turnStatus.js.map +1 -0
- package/dist/proxy/ProxySessionController.js +688 -153
- package/dist/proxy/ProxySessionController.js.map +1 -1
- package/dist/runtime/submissionErrors.js +15 -0
- package/dist/runtime/submissionErrors.js.map +1 -0
- package/dist/scheduling/ScheduleCards.js +240 -0
- package/dist/scheduling/ScheduleCards.js.map +1 -0
- package/dist/scheduling/ScheduleCommand.js +67 -0
- package/dist/scheduling/ScheduleCommand.js.map +1 -0
- package/dist/scheduling/ScheduledTaskStore.js +226 -0
- package/dist/scheduling/ScheduledTaskStore.js.map +1 -0
- package/dist/scheduling/TaskScheduler.js +132 -0
- package/dist/scheduling/TaskScheduler.js.map +1 -0
- package/dist/scheduling/types.js +89 -0
- package/dist/scheduling/types.js.map +1 -0
- package/dist/state/ExecutionProvenanceStore.js +58 -0
- package/dist/state/ExecutionProvenanceStore.js.map +1 -0
- package/dist/state/StateStore.js +145 -45
- package/dist/state/StateStore.js.map +1 -1
- package/dist/state/migrations.js +37 -0
- package/dist/state/migrations.js.map +1 -1
- package/dist/supervision/SafeRestartNotifier.js +1 -1
- package/dist/supervision/SafeRestartNotifier.js.map +1 -1
- package/docs/technical-reference.md +11 -8
- package/docs/technical-reference.zh.md +11 -8
- package/npm-shrinkwrap.json +24 -2
- package/package.json +2 -1
- package/skills/agent-bot/SKILL.md +33 -3
- package/src/cli/controlProtocol.ts +1 -0
- package/src/cli/help.ts +14 -0
- package/src/cli.ts +25 -0
- package/src/codex/CodexRuntime.ts +14 -5
- package/src/commands/CommandRouter.ts +7 -0
- package/src/commands/commandTypes.ts +2 -0
- package/src/config/SettingsStore.ts +588 -0
- package/src/config/loadConfig.ts +1 -2
- package/src/config/schema.ts +0 -1
- package/src/console/ConsoleTurnPresenter.ts +2 -0
- package/src/feishu/CardRenderer.ts +33 -110
- package/src/feishu/FeishuConnector.ts +9 -0
- package/src/feishu/FeishuMessageClient.ts +39 -17
- package/src/feishu/FeishuTurnPresenter.ts +33 -22
- package/src/feishu/LocalCardImage.ts +0 -1
- package/src/feishu/LocalImageMarkdown.ts +54 -3
- package/src/feishu/SettingsCard.ts +231 -0
- package/src/index.ts +17 -6
- package/src/local-files/TurnPreviewPage.ts +8 -4
- package/src/presentation/TurnStateReducer.ts +21 -2
- package/src/presentation/turnStatus.ts +38 -0
- package/src/presentation/turnViewTypes.ts +3 -0
- package/src/proxy/ProxySessionController.ts +628 -152
- package/src/runtime/submissionErrors.ts +15 -0
- package/src/runtime/types.ts +1 -0
- package/src/scheduling/ScheduleCards.ts +317 -0
- package/src/scheduling/ScheduleCommand.ts +76 -0
- package/src/scheduling/ScheduledTaskStore.ts +332 -0
- package/src/scheduling/TaskScheduler.ts +171 -0
- package/src/scheduling/types.ts +151 -0
- package/src/state/ExecutionProvenanceStore.ts +100 -0
- package/src/state/StateStore.ts +167 -44
- package/src/state/migrations.ts +37 -0
- package/src/supervision/SafeRestartNotifier.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,33 @@ The project follows [Semantic Versioning](https://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.1.25-alpha.2] - 2026-11-19
|
|
10
|
+
|
|
11
|
+
- Automatically migrate legacy recent-context receipt tables at startup without losing records or guessing source Prompts; distinguish local-state failures from Feishu permission errors, and keep accepted tasks running if receipt persistence fails.
|
|
12
|
+
|
|
13
|
+
- Unify local image handling at the Feishu outbound boundary for all cards and final answers, including live thinking-card updates; reuse uploads, degrade unavailable images to text, and preserve code examples, native image keys and callback data without per-card opt-in flags.
|
|
14
|
+
|
|
15
|
+
- Remove the retired chronological thinking-card renderer, layout configuration and fixed-count pagination. Progress, execution-details and history cards now share grouped rendering; saved history and web Preview are unchanged.
|
|
16
|
+
|
|
17
|
+
- Add owner-only `/settings` panels with a compact Common-first layout for Profile and per-Agent defaults, response/display policies and service options, with validated atomic YAML saves, stale-card protection and explicit safe-restart activation; existing tasks and history remain unchanged.
|
|
18
|
+
- Keep the Agent settings page to model, reasoning and permission dropdowns, using runtime catalogs with model/effort validation and preserving existing Provider settings and unavailable current values.
|
|
19
|
+
- Autosave settings per component without a page Save button, protect independent edits with field revisions, and keep invalid input unsaved. Single-Agent profiles show Provider/model defaults on Common instead of an Agent selector; the public base URL remains YAML-only.
|
|
20
|
+
|
|
21
|
+
- Keep Provider/model/thinking/permission changes scoped to the selected task without changing Agent defaults or conversation history.
|
|
22
|
+
- Persist submission boundaries: reattach known turns, retry only proven unsubmitted requests, and show uncertain execution as unverified without replaying old instructions.
|
|
23
|
+
- Persist Stop across preparation, retries, continuations and restarts; retain independent queued messages and verify termination instead of assuming an interrupt succeeded.
|
|
24
|
+
- Keep cards, task status and Preview consistent across disconnects and late events, without duplicating final replies.
|
|
25
|
+
- Record minimal execution provenance and effective dispatch settings in `/turn` details; preserve logical instruction identity across authorized continuations.
|
|
26
|
+
- Add cross-module regression tests for settings isolation, ambiguous requests, cancellation races, scheduling, migrations, Preview and delivery deduplication.
|
|
27
|
+
|
|
28
|
+
## [0.1.25-alpha.1] - 2026-11-05
|
|
29
|
+
|
|
30
|
+
- 修复状态卡片将最终回答中的本地图片路径误当成飞书图片 key 导致发送失败:本地及外部任务的结果、执行详情复用图片上传缓存,覆盖发送、话题回复和刷新;缺失或上传失败时降级为文字,不改变普通工具日志。
|
|
31
|
+
- 新增第一期定时任务:通过 `/schedule` 卡片或 `agentbot schedule` 创建一次性/五段 Cron 计划,确认后绑定已有任务执行;支持编辑、暂停/恢复、立即运行、删除和执行记录,保留原会话/话题路由及任务设置。
|
|
32
|
+
- 调度与队列事务去重,忙时排队、不追加指令,默认错过不补跑、重叠跳过、60 分钟最晚开始;支持显式有限补跑。提交不明确时等待核实,不自动重发;兼容安全重启和现有 App Server 活跃轮次恢复。
|
|
33
|
+
- 定时任务实际开始时,先向原会话或话题发送原始 Prompt,再创建思考卡片;排队、恢复及方案确认续执行不重复发送,Prompt 发送失败时不提交模型并暂停已启用计划。
|
|
34
|
+
- 定时任务卡片分离计划详情与执行记录,计划操作与单次运行管理不再混排;改用轻量导航,刷新保留当前视图,合并重复时间信息并弱化计划 ID。
|
|
35
|
+
|
|
9
36
|
## [0.1.25-alpha.0] - 2026-10-30
|
|
10
37
|
|
|
11
38
|
- 修复合并转发聊天记录中的图片、文件下载失败:改用外层消息 ID 读取资源,同时覆盖直接转发和引用聊天记录,保留用户正文为主 Prompt。
|
package/README.md
CHANGED
|
@@ -10,14 +10,22 @@ Use local Codex, TraeX, and compatible ACP agents through Feishu.
|
|
|
10
10
|
|
|
11
11
|
Agent Bot runs on your computer and connects a Feishu bot to your local coding agents. Send a message to start working; the bot updates a progress card while the agent runs and sends the final answer as Markdown.
|
|
12
12
|
|
|
13
|
+
Cards, task lists and Turn Preview show **Unverified** when execution cannot be confirmed. Connection loss is not a failed or completed task; a later verified result updates the same card. Preview connectivity and final-message delivery are tracked separately from execution.
|
|
14
|
+
|
|
13
15
|
## What You Can Do
|
|
14
16
|
|
|
17
|
+
Recovery separates reattachment from resubmission. Only durably confirmed unsubmitted requests may retry automatically. Known active turns are reattached; ambiguous timeouts, disconnects and missing turn IDs are marked unverified without replay or timestamp-based adoption. Automatic queue dispatch pauses while unresolved, preserving queued messages; inspect execution records and send a new message to continue. Transient errors after submission no longer replay the original Prompt.
|
|
18
|
+
|
|
19
|
+
Stop persists its cancellation boundary before network operations. Pending preparation, retries and automatic continuations accepted before Stop cannot launch afterward, including after restart. An unsuccessful interrupt remains requested, not silently undone; termination is reported only when verified. Stop does not delete independent queued messages or future schedules. A new explicit instruction can start new work.
|
|
20
|
+
|
|
21
|
+
`/turn <id or index>` details show the execution source, original instruction ID, dispatch time, optional parent Turn/planned time, and actual Agent/Provider/model/thinking/permission settings at submission. This metadata survives restart; ordinary progress cards are unchanged, and historical records without provenance are not guessed or backfilled.
|
|
22
|
+
|
|
15
23
|
- Use your existing local Codex or TraeX login from Feishu
|
|
16
24
|
- Create, continue, switch, fork, and stop tasks
|
|
17
25
|
- Reset the current conversation from any successfully completed progress card
|
|
18
26
|
- Collaborate with text, images, files, quoted messages, merged-forwarded chat records, group chats, and topics
|
|
19
27
|
- Queue follow-up Prompts or add instructions while a task is running
|
|
20
|
-
- Automatically retry
|
|
28
|
+
- Automatically retry proven pre-submission transient failures
|
|
21
29
|
- Continue existing work after Agent Bot restarts
|
|
22
30
|
- Run through the local Console UI without Feishu
|
|
23
31
|
|
|
@@ -268,6 +276,7 @@ Send a message beginning with `/` to run a command. Use `/help` in Feishu for th
|
|
|
268
276
|
| `/thinking` | Set reasoning effort |
|
|
269
277
|
| `/permissions` | Set execution permissions |
|
|
270
278
|
| `/agent [name]` | Choose the Agent for new tasks |
|
|
279
|
+
| `/settings` | Configure Profile and Agent defaults (owner only) |
|
|
271
280
|
| `/newgroup [title] [--agent <name>] [--dir <path> \| --nodir]` | Start a task in a new private group |
|
|
272
281
|
| `/forkgroup [title]` | Branch a task into a new private group |
|
|
273
282
|
| `/clonegroup [title] [--agent <name>]` | Transfer dialogue into a new private group |
|
|
@@ -292,10 +301,54 @@ In a group, `/mute` and `/mute on` make the bot process only messages that menti
|
|
|
292
301
|
|
|
293
302
|
Only groups explicitly enabled with `/mute` or `/mute on` supplement ordinary @-mention Prompts with recent human text and images. Topic requests read only that topic; ordinary group requests exclude topic messages. Reads are limited to two reverse-chronological pages of 30 messages, selecting up to 20 messages before the triggering mention, 16,000 text characters (2,000 per message), and six additional images, newest first. Bot messages, deleted messages, and later messages are excluded; non-image attachments and forwarded bundles are not expanded automatically. The original question remains the card Prompt. Included context is marked as reference data, not authorization. Successful submissions persist a bounded deduplication ledger scoped to the task, remote branch, and conversation. Scanning stops at the first message already submitted to that Agent conversation (either a direct Prompt or previously injected context): that message and all older messages are excluded, and no earlier page is requested. Queued-but-not-submitted context is deduplicated without becoming a stop boundary. `/mute off`, private chats, unmentioned messages, and slash/Shell commands do not trigger this read. Existing topic-root and explicit-reply handling remains unchanged. Reading requires the bot to have the relevant Feishu history/group-message/resource permissions; denied reads or image-download failures are reported without submitting an incomplete Prompt. This feature does not enable permissions automatically.
|
|
294
303
|
|
|
304
|
+
Older databases upgrade automatically at startup, including recent-context receipts created without a source Prompt field. Existing records are retained, but unknown sources are not guessed or used as conversation stop boundaries. Local database read errors are not labeled as Feishu permission failures. A receipt-write failure after a Prompt has been accepted is logged without marking the running task failed or automatically resubmitting it.
|
|
305
|
+
|
|
295
306
|
`/new` and `/newgroup` use the conversation's default Agent unless `--agent <name>` selects another configured Agent for this task only; the source conversation's default is unchanged. For example, `/new Fix tests --agent codex` or `/newgroup Review --agent traex --dir ~/dev/project`. They inherit the current project; execution settings are inherited only when the selected Agent matches the current task's Agent, otherwise Provider, model, reasoning, and permission mode use the target Agent's saved defaults. Use `--dir` to choose another directory or `--nodir` to start without a project directory; `--nodir` requires the selected Agent to be App Server, and `~` represents your home directory.
|
|
296
307
|
|
|
297
308
|
`/dir` opens the file browser. `NewFolder` creates a child directory and opens it in the same card at page one, without changing the task's working directory. `Back` cancels creation and restores the previous directory and page.
|
|
298
309
|
|
|
310
|
+
### Global Settings Panel
|
|
311
|
+
|
|
312
|
+
Send `/settings` to configure the current Profile. It opens on Common, with compact tabs for Common, Agent, Group names and Advanced. Only the configured Agent Bot owner can use it, including when normal conversations accept other users; no current task is required.
|
|
313
|
+
|
|
314
|
+
| Section | Options |
|
|
315
|
+
| --- | --- |
|
|
316
|
+
| Common | Default Agent when multiple Agents are configured; otherwise default Provider and model. Also owner-only responses, all-group-message responses and automatic stable updates |
|
|
317
|
+
| Agent | Default model, reasoning effort and permissions as dropdowns; with one Agent, model selection moves to Common and no Agent selector is shown. Select Use Agent default to clear an override |
|
|
318
|
+
| Group names | Project/projectless templates and date format |
|
|
319
|
+
| Advanced | Console, web terminal, file/Turn Preview, listen host/port and log level |
|
|
320
|
+
|
|
321
|
+
Each control saves independently to the Profile YAML, with no separate Save button. Selectors and checkboxes save on change; text and number fields save when Feishu sends their native input-submit callback (use the input's own submit icon, not a page Save button). Feishu does not expose a blur/keystroke callback. Invalid input keeps the previous value and displays an error on the same card. **Changes take effect after a safe restart**, which remains an explicit action waiting for active tasks, terminals and final delivery. Field-level revision checks prevent stale overwrites while independent edits can be saved from the same card. No-op saves preserve the file exactly; updates retain comments, environment references and unrelated fields.
|
|
322
|
+
|
|
323
|
+
Agent model and reasoning choices come from that Agent's configured Provider, preserving upstream IDs and display names. The reasoning dropdown lists available efforts; saving validates the chosen model/effort pair. Changing the single Agent's default Provider retains its model when supported, otherwise selects the new Provider's default/first available model (or uses the Agent default if discovery is unavailable). Incompatible reasoning overrides return to the Agent default. Discovery failures show a warning; unrelated edits retain unavailable current values. The public base URL is not editable in this panel; existing `fileViewer.publicBaseUrl` values remain unchanged and can still be managed in YAML.
|
|
324
|
+
|
|
325
|
+
Global defaults never rewrite existing tasks or history; same-Agent new tasks and forks still prefer inherited settings. Naming changes do not rename existing groups. All-group-message mode still requires the corresponding Lark permissions and does not grant them automatically. Credentials, owner identity, Agent launch commands/environment, database/log paths and Lark transport debugging options remain local configuration or `agentbot init` concerns and are not displayed on cards.
|
|
326
|
+
|
|
327
|
+
### Scheduled Tasks
|
|
328
|
+
|
|
329
|
+
`/schedule` opens this conversation's plans: create/edit forms, confirmation, pause/resume, run-now, deletion, and the latest ten run records. Plan details and run history use separate views: plan controls stay in details, while history only offers per-run details and verification. Compact navigation switches views, refreshes the current view, or returns to the list. Only the configured Agent Bot owner can manage them in Lark. A plan targets an existing local task and preserves its original private/group/topic reply route; switching the current task does not retarget it. Execution follows that task's current Provider, model, and permissions, without forking, changing history, or elevating permissions.
|
|
330
|
+
|
|
331
|
+
The CLI uses the same service and prints JSON:
|
|
332
|
+
|
|
333
|
+
```powershell
|
|
334
|
+
agentbot schedule add --task <task> --name "Build check" --cron "0 9 * * 1-5" --timezone Asia/Singapore --prompt "Check the project build"
|
|
335
|
+
agentbot schedule add --task <task> --at "2026-12-01T10:00:00+08:00" --prompt "Check the build result"
|
|
336
|
+
agentbot schedule list
|
|
337
|
+
agentbot schedule show <schedule-id>
|
|
338
|
+
agentbot schedule history <schedule-id>
|
|
339
|
+
agentbot schedule pause <schedule-id>
|
|
340
|
+
agentbot schedule resume <schedule-id>
|
|
341
|
+
agentbot schedule run <schedule-id>
|
|
342
|
+
agentbot schedule edit <schedule-id> --cron "0 10 * * 1-5" --prompt "Check the project build"
|
|
343
|
+
agentbot schedule delete <schedule-id>
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
Creation/editing saves a draft and sends a confirmation card to the original conversation. The owner must confirm before activation. Inside an Agent Bot Agent, `add` may omit `--task`. Slash commands accept the same operations/options without `--task`. Cron has five fields (minute precision); `--at` requires an ISO timestamp with an offset. Each plan stores an IANA timezone, defaulting to the host's timezone at creation. Prompts are limited to 1,000 characters to match Lark forms. `edit` replaces the full specification. CLI lists return up to 100 plans; Lark lists are paginated.
|
|
347
|
+
|
|
348
|
+
Scheduled Prompts enter the persistent queue as independent Turns, never steering active work. When execution starts, Agent Bot first posts the original Prompt to the plan's original conversation/topic, then sends the thinking card and submits the Turn. Nothing is posted while merely waiting in the queue; recovery and approved-plan continuation do not repost the Prompt. If posting the Prompt fails, no Turn is submitted and enabled plans are paused. Each plan permits one queued/running/unconfirmed occurrence; overlaps are skipped. `--max-delay <minutes>` sets the latest start relative to the scheduled time (default 60). Before submission Agent Bot rechecks expiration, pause/delete, owner, target, and safe-restart state. Pause/delete cancels queued/preparing work, not submitted work; use normal Stop for active work. Run-now does not change the calendar.
|
|
349
|
+
|
|
350
|
+
Missed occurrences after restart, sleep, or a delay over one minute are skipped by default. `--catch-up <minutes>` opts into only the latest missed occurrence inside that window, still subject to `--max-delay`; history is never replayed in bulk. Plan/run/queue writes are transactional and deduplicated. Known active App Server Turns can be reattached; ambiguous submissions and interrupted runs are not automatically resubmitted. Verify the Agent's state, then use **已核实结束** in run history to unblock an unconfirmed occurrence. Closed targets and owner changes pause plans. Safe restart suspends dispatch. The host and service must be running; automatic wake-up is not provided. Timing is best-effort (five-second polling plus queue wait), not hard real-time.
|
|
351
|
+
|
|
299
352
|
`/file` accepts relative paths, absolute paths, and paths beginning with `~`; relative paths resolve from the current task directory.
|
|
300
353
|
|
|
301
354
|
`/fork` and `/forkgroup` branch from completed work without interrupting a running turn. `/sessions` manages tasks across projects and Providers in pages of up to 10 tasks; switching Provider does not hide a task from the list or search. Use each project menu for `New` and `NewGroup`. Each task’s `SwitchGroup` action creates a new group bound to that same task, preserving its history, title, and execution settings without creating or forking an Agent task. The original conversation stays unchanged. An Agent Bot Turn already in progress keeps replying to its original conversation; new messages from the new group queue until it finishes. Tasks running in an external client cannot be switched until they finish. Expanding a task directly shows the first 50 characters of its latest user Prompt, its update time, and task-specific actions. Running tasks also show a direct `Stop` button, including the current task and tasks running in other conversations or external clients. It sends the normal Agent interrupt without switching tasks or killing processes. The list refresh preserves search and pagination and keeps Stop available until the Agent reports the task idle; Archive is available only when idle. Use `Turns` to view that task’s history without switching tasks, including tasks not yet bound to Agent Bot; non-current tasks are read-only until you switch to them. `/turns` restores conversation context without reverting local files.
|
|
@@ -354,6 +407,8 @@ Relative file links in Feishu answers and thinking cards, such as `outputs/repor
|
|
|
354
407
|
|
|
355
408
|
`/status` cards also include **Preview** beside Refresh and Stop/Switch. It opens the active Turn, or the latest Turn when idle, and updates its target when you refresh the card. For external tasks not yet recorded by Agent Bot, opening Preview loads the selected Turn from the Agent and caches its full execution details. Read failures can be retried by refreshing the page. The button is hidden if there is no Turn, no supported history reader, or the file viewer is unavailable. Viewing another task’s status does not switch or take over that task.
|
|
356
409
|
|
|
410
|
+
All Feishu cards and final answers share one outbound image pipeline for sending, replying and updating. Local Markdown images become previewable Feishu images, with unchanged uploads reused across cards and refreshes. Missing files or upload failures fall back to readable text without blocking the card. Code examples, existing Feishu image keys and button callback data remain unchanged; individual cards do not need image-processing flags.
|
|
411
|
+
|
|
357
412
|
Progress cards include a `Preview` button that opens the saved Turn timeline in a compact, mobile-friendly browser view. Reasoning panels use the content title as their collapsed header and show the text directly on expansion. Tool blocks have a single collapse level and start collapsed with a meaningful one-line command summary, a compact duration (`58s` or `2:32`), and completion status. Expanding a block shows the full command prefixed by `$`, followed directly by its results, images, and changed files. Identical output/error logs appear once. Running Turns update live by patching changed sections in place, preserving expanded or collapsed steps, scroll positions, and unchanged image elements instead of reloading them. Token and other metadata updates do not replace the timeline. Collapsed tool steps and the file-change summary initially contain only their headers; commands, logs, images, and file lists are fetched on expansion. Reopening reuses loaded content, and live updates refresh only expanded details whose content changed. Failed loads offer Retry. Finished Turns do not open a live SSE connection. The waiting-for-progress placeholder is hidden once a response or other visible progress is available, and is never shown for finished Turns. Click a file in the file changes or tool file list to preview its current contents in a new tab; deleted or unavailable files remain plain text. Turn previews use the same signed viewer address and access rules as local file links. Beside Final answer, download and copy icons export the original Markdown (including formatting, code blocks, and unchanged link targets), not the rendered HTML. Download saves a UTF-8 `.md` file; Copy uses the clipboard with a fallback for HTTP/LAN previews and shows success or failure feedback. Both work on completed pages and when the final answer arrives live.
|
|
358
413
|
|
|
359
414
|
Opening `/turn <ID or index>` or Preview for an imported summary loads that Turn's execution details from its original Agent session and caches the result. Only summary pages and the selected Turn's full record are requested, never the entire full history; source tasks are not resumed or interrupted. Read failures show their reason separately from the Turn's execution status; reopen the details or refresh Preview to retry. Existing detailed snapshots remain unchanged, and unavailable historical timing or token data is not estimated.
|
|
@@ -398,13 +453,13 @@ HTML files (`.html` and `.htm`) open in preview mode with a code toggle, line an
|
|
|
398
453
|
|
|
399
454
|
CSV files (`.csv`, case-insensitive) open as read-only tables with row numbers, column letters, sticky labels, and horizontal/vertical scrolling. The first row remains data, not an inferred header. Standard comma-separated fields support quoted commas, escaped quotes, embedded newlines, empty cells, and UTF-8/UTF-16 BOM or GB18030 text decoding; numeric strings and formulas remain plain text. Preview reads at most the first 2 MiB and displays up to 500 records, 50 columns, and 4,000 characters per cell, with explicit truncation or malformed-quote notices. Incomplete records at the byte boundary are omitted. The code view displays up to 2,000 physical lines; raw/download links preserve the entire original file. Live updates retain the selected view and table scroll position.
|
|
400
455
|
|
|
401
|
-
Provider, model, reasoning effort, and permission choices apply to the current task
|
|
456
|
+
Provider, model, reasoning effort, and permission choices apply only to the current task; they never create or update Agent defaults in `config.yaml`. Use the Agent defaults page in `/settings` or explicitly edit `agents.<name>.defaults` to choose defaults for unrelated new tasks. Same-Agent `/new` and `/newgroup` still inherit the source task's settings, and `/fork` and `/forkgroup` preserve source-task settings and history.
|
|
402
457
|
|
|
403
458
|
For App Server tasks, permission changes apply both approval and sandbox policies on the next Turn: `auto` uses no sandbox and no approval prompts; `confirm` uses the workspace-write sandbox and on-request approval. Choose the mode in `/permissions`, or use `agentbot task permissions auto|confirm`. Switching requires no Agent restart, fork, or new task and does not change already-running tool processes or steering requests. Workspace writable roots, network access, and temporary-directory exclusions retain the Agent's configured values.
|
|
404
459
|
|
|
405
460
|
The execution settings card ends with a one-sentence Markdown blockquote for the selected tab's scope and timing. Agent selection changes only the default for new tasks in that conversation, without migrating the current task. Model, reasoning, and permission changes apply from the next turn. Agent and Provider options show their identifiers without duplicate display names, while retaining current/default indicators. `/provider` opens this card even when only one Provider is available, keeping the Model, Thinking, and Permission tabs accessible.
|
|
406
461
|
|
|
407
|
-
Provider changes requested during an Agent Bot turn are saved as pending without interrupting it. The settings card immediately shows the target Provider and the model that will be used; the Model tab lists that Provider’s models, and later selections replace the pending choice. Thinking and permission changes made while a Provider switch is pending are staged with it. The switch is applied after the current turn ends, before a queued, retried, or new turn starts; idle tasks switch immediately. Pending settings survive restarts and do not overwrite active settings
|
|
462
|
+
Provider changes requested during an Agent Bot turn are saved as pending without interrupting it. The settings card immediately shows the target Provider and the model that will be used; the Model tab lists that Provider’s models, and later selections replace the pending choice. Thinking and permission changes made while a Provider switch is pending are staged with it. The switch is applied after the current turn ends, before a queued, retried, or new turn starts; idle tasks switch immediately. Pending settings survive restarts and do not overwrite active settings until applied; applying them never changes Agent defaults. If a deferred switch fails, Agent Bot restores the previous Provider and model. After verified rollback, the card returns to the original settings with an error notice, clears the pending choice, and queued/new turns continue using the original settings. Only failed or unverified rollback pauses further turns and keeps queued prompts for manual recovery. For a custom Provider, Agent Bot uses its OpenAI-compatible `/models` endpoint when available and shows only that Provider's models. A switch keeps the previous model when the target supports it, otherwise selects the target's default model or its first returned model. Providers without a model-list endpoint remain usable: Agent Bot keeps the current or configured model as the single fallback candidate and lets Codex apply it. Agent Bot verifies the task ID, Provider, and model before saving or reporting success. Tasks with history always preserve their remote thread ID and all history, including failed and interrupted Turns. Before the first message, a verified empty task without inherited history or a Goal may switch through a new remote thread, keeping the same local task, conversation, directory, and title. The old thread remains attached until the new Provider/model and persistence succeed; failure keeps the original task. No synthetic Prompt or history rewrite is used. If a switch fails, the previous settings are retained and remote recovery is attempted. If recovery also fails, further turns are blocked until a Provider switch succeeds.
|
|
408
463
|
|
|
409
464
|
For TraeX's built-in `trae` Provider, Agent Bot uses the complete native `model/list` catalog, including model names and reasoning options, without requiring a custom Provider `base_url`. Other custom Providers keep their own model discovery and fallback behavior.
|
|
410
465
|
|
|
@@ -426,7 +481,7 @@ By default, `feishu.respondToOwnerOnly: true` accepts only messages and card act
|
|
|
426
481
|
|
|
427
482
|
Agent Bot responds to ordinary owner messages in groups containing the bot. Set `feishu.respondToAllGroupMessages` to `false` to additionally require the owner to @ the bot in groups; private chats are unchanged. Initialization requests the manually published all-group-message permission only when this option is enabled. After changing it from `false` to `true`, rerun `agentbot init` and complete the final permission step.
|
|
428
483
|
|
|
429
|
-
Thinking cards use the grouped layout
|
|
484
|
+
Thinking cards, execution details and activity-history cards use only the grouped layout: auxiliary Commentary and user steering remain visible, while each execution group shows only its latest native reasoning and expands to reveal complete tool commands and results. Common PowerShell, zsh, bash, and sh launcher prefixes are omitted from the displayed commands. A failed tool remains marked inside its own tool panel but does not turn the complete execution group red or give the group a failure icon. Execution groups start collapsed and keep stable component identities so a group manually opened in Feishu stays open across card updates. When Codex compacts its context, the card shows the live compaction state as a progress activity, including elapsed time, before/after context token counts, executed Turn count, and rollout disk usage when available. On long turns, pagination measures the fully rendered card content instead of using fixed message or tool counts. The retired layout option is ignored in existing configuration; saved history and web Preview are unchanged.
|
|
430
485
|
|
|
431
486
|
Whitespace-only Commentary does not use a pinned message slot. Adjacent omission markers generated by the card are shown once, without removing literal message text or changing saved history.
|
|
432
487
|
|
|
@@ -442,7 +497,7 @@ File-change summaries display paths as plain text, preserving Windows separators
|
|
|
442
497
|
|
|
443
498
|
## Troubleshooting
|
|
444
499
|
|
|
445
|
-
After a crash,
|
|
500
|
+
After a crash, Agent Bot checks recent attempts without replaying submitted work. Writer conflicts stop checks immediately; other unconfirmed checks stop after one minute and leave execution unverified. Already-confirmed live turns remain monitored, including during temporary connection outages. No external process is closed automatically.
|
|
446
501
|
|
|
447
502
|
- **The bot does not respond:** run `agentbot server status` and check today's `~/.agent-bot/logs/agent-bot.YYYY-MM-DD.log`
|
|
448
503
|
- **The Worker restarted after a Node crash:** check `~/.agent-bot/data/last-crash.json`, that day's `~/.agent-bot/logs/worker.stderr.YYYY-MM-DD.log`, and `~/.agent-bot/data/crash-reports/`
|
package/README.zh.md
CHANGED
|
@@ -10,14 +10,22 @@
|
|
|
10
10
|
|
|
11
11
|
Agent Bot 运行在你的电脑上,把飞书机器人连接到本机编程 Agent。发送消息即可开始工作;执行过程中机器人会更新进度卡,完成后发送 Markdown 最终回答。
|
|
12
12
|
|
|
13
|
+
无法确认执行结果时,卡片、任务列表和 Turn Preview 显示 **待核实**。连接中断不代表任务失败或完成;后续确认结果会更新原卡片。网页连接状态、最终回答投递状态与任务执行状态分别记录。
|
|
14
|
+
|
|
13
15
|
## 可以做什么
|
|
14
16
|
|
|
17
|
+
任务恢复区分重连与重发:只有持久化记录明确证明尚未提交的请求可以自动重试。已确认的活跃轮次只重连;提交超时、断连或缺失轮次 ID 显示“待核实”,不重发原 Prompt,也不凭时间匹配其他轮次。待核实时自动队列暂停,排队消息仍保留;核实执行记录后发送新消息继续。已提交轮次的临时模型错误不再触发原 Prompt 重放。
|
|
18
|
+
|
|
19
|
+
Stop 在网络操作前持久化停止边界。停止之前的准备、重试和自动续接不能在之后启动,重启后仍有效。中断失败不会撤回停止意图,也不会假报已经停止。Stop 不删除独立排队消息或未来的定时计划;新的明确指令仍可启动新工作。
|
|
20
|
+
|
|
21
|
+
`/turn <id 或序号>` 的执行详情显示触发来源、原始指令 ID、发起时间、来源轮次或计划时间,以及提交时实际使用的 Agent、Provider、模型、思考强度和权限。记录跨重启保留,不增加进度卡或改变普通思考卡片;旧轮次没有来源记录时不猜测补全。
|
|
22
|
+
|
|
15
23
|
- 在飞书中使用本机已有的 Codex 或 TraeX 登录
|
|
16
24
|
- 创建、继续、切换、分支和停止任务
|
|
17
25
|
- 从任意成功完成的思考卡片重置当前对话
|
|
18
26
|
- 使用文字、图片、文件、引用消息、合并转发记录、群聊和话题协作
|
|
19
27
|
- 排队后续 Prompt,或在任务运行中追加指令
|
|
20
|
-
-
|
|
28
|
+
- 仅对确认尚未提交的临时错误自动重试
|
|
21
29
|
- Agent Bot 重启后继续已有工作
|
|
22
30
|
- 不使用飞书时通过本地 Console UI 运行
|
|
23
31
|
|
|
@@ -265,6 +273,7 @@ agentbot task dismiss [任务] --yes
|
|
|
265
273
|
| `/thinking` | 设置思考强度 |
|
|
266
274
|
| `/permissions` | 设置执行权限 |
|
|
267
275
|
| `/agent [名称]` | 选择新任务使用的 Agent |
|
|
276
|
+
| `/settings` | 配置 Profile 和 Agent 默认值(仅所有者) |
|
|
268
277
|
| `/newgroup [标题] [--agent <名称>] [--dir <路径> \| --nodir]` | 在新私有群中开始任务 |
|
|
269
278
|
| `/forkgroup [标题]` | 将任务分支到新私有群 |
|
|
270
279
|
| `/clonegroup [标题] [--agent <名称>]` | 将对话上下文迁移到新私有群 |
|
|
@@ -293,10 +302,54 @@ Fork 只记录来源任务和分支轮次,不同步完整历史。普通任务
|
|
|
293
302
|
|
|
294
303
|
只有显式开启 `/mute` 或 `/mute on` 的群,普通 @ 提问才会自动补充近期成员文字和图片。话题内仅查询当前话题,普通群主会话排除其他话题消息。最多倒序读取 2 页、每页 30 条,从中选取本次 @ 之前最多 20 条消息;文字上限 16,000 字符、单条 2,000 字符,额外图片最多 6 张,优先最近内容。排除机器人、已删除及后续消息,不自动展开文件附件或合并转发。卡片 Prompt 保留原始提问,补充内容标记为参考资料而非操作授权。提交成功后按任务、远端分支和群/话题持久化有限的去重记录。从新到旧扫描,遇到第一条已提交给当前 Agent 会话的消息(普通提问或已补充的上下文)立即停止:不重复附带该消息,不提取更早内容,也不再请求更早一页。仅在队列中尚未提交的上下文只去重,不作为停止边界。`/mute off`、私聊、未 @ 消息、斜杠及 Shell 命令不触发补读;原有话题根消息和显式引用逻辑不变。机器人需要相应的飞书历史消息、群消息和资源权限;读取或图片下载失败会明确提示,不向 Agent 提交残缺请求,也不会自动开启权限。
|
|
295
304
|
|
|
305
|
+
旧数据库会在启动时自动升级,包括缺少来源 Prompt 字段的近期上下文记录。已有记录保留,但无法确认的来源不猜测、不作为停止边界。本地数据库读取失败不会误报为飞书权限不足;Prompt 已被接受后,去重记录写入失败只记录警告,不把正在执行的任务标为失败,也不自动重发。
|
|
306
|
+
|
|
296
307
|
`/new` 和 `/newgroup` 默认使用当前会话设置的默认 Agent,也可用 `--agent <名称>` 为本次任务指定已配置的 Agent,不改变源会话的默认值。例如:`/new 修复测试 --agent codex`、`/newgroup 代码审查 --agent traex --dir ~/dev/project`。项目目录仍继承当前任务;选中的 Agent 与当前任务相同时继承运行设置,不同时使用目标 Agent 已保存的 Provider、模型、思考强度和权限默认值。使用 `--dir` 指定其他目录,或使用 `--nodir` 创建无项目目录的任务;`--nodir` 要求选中的 Agent 为 App Server,`~` 表示用户主目录。
|
|
297
308
|
|
|
298
309
|
`/dir` 打开文件浏览卡片。`NewFolder` 创建子目录后,原卡片直接进入新目录的第一页,不改变任务工作目录;`Back` 取消创建并回到原目录和页码。
|
|
299
310
|
|
|
311
|
+
### 全局配置面板
|
|
312
|
+
|
|
313
|
+
发送 `/settings` 打开当前 Profile 的配置面板,默认进入“常用”,顶部提供常用、Agent、群名、高级四个紧凑页签。仅 Agent Bot 所有者可操作,无需先创建任务。
|
|
314
|
+
|
|
315
|
+
| 分组 | 可配置选项 |
|
|
316
|
+
| --- | --- |
|
|
317
|
+
| 常用 | 多 Agent 时设置默认 Agent;仅有一个 Agent 时直接设置默认 Provider 和模型。另有仅响应所有者、响应群内所有消息、正式版自动更新 |
|
|
318
|
+
| Agent | 默认模型、默认思考强度、默认权限下拉列表;仅有一个 Agent 时模型移至常用页,不显示 Agent 选择器。选择“使用 Agent 默认”可清除覆盖值 |
|
|
319
|
+
| 群名 | 项目群和无项目群的命名模板、日期格式 |
|
|
320
|
+
| 高级 | 本地控制台、网页终端、文件与 Turn 预览、监听地址、端口、日志级别 |
|
|
321
|
+
|
|
322
|
+
各配置项独立保存到当前 Profile 的 YAML,不再提供单独的“保存”按钮。下拉框和开关在变更后保存;文本和数字输入框在飞书回传输入内容后保存,需要点击输入框自身的提交图标,飞书不提供失焦或逐字输入回调。无效输入不会写入,并在原卡片显示错误。**安全重启后生效**,仍需独立点击安全重启按钮,等待活跃任务、终端和结果投递结束。逐项版本校验防止覆盖同一项的新值,同一卡片修改不同项不会互相覆盖。无修改保存不重写文件;注释、环境变量引用和无关配置保持不变。
|
|
323
|
+
|
|
324
|
+
模型和思考强度选项来自该 Agent 已配置的 Provider,保留上游 ID 和显示名称。思考强度下拉列出可用强度,保存时校验与所选模型是否兼容。单 Agent 切换默认 Provider 时,原模型受支持则保留,否则选择新 Provider 的默认或首个可用模型;列表不可用时使用 Agent 默认。不兼容的思考强度覆盖值恢复为 Agent 默认。列表获取失败会显示提示,修改其他设置不会清除不可用的当前值。“对外访问地址”不再出现在面板中;已有 `fileViewer.publicBaseUrl` 保持不变,仍可通过 YAML 管理。
|
|
325
|
+
|
|
326
|
+
全局默认值不会修改已有任务或历史;同 Agent 的新建任务和 Fork 仍优先继承来源设置。修改群名模板不会重命名已有群。开启群内全消息响应仍需飞书对应权限,不会自动申请授权。密钥、所有者身份、Agent 启动命令/环境变量、数据库及日志路径、飞书传输调试选项仍通过本机配置或 `agentbot init` 管理,不显示在卡片中。
|
|
327
|
+
|
|
328
|
+
### 定时任务
|
|
329
|
+
|
|
330
|
+
`/schedule` 打开当前私聊、群或话题的计划列表,提供新建/编辑表单、确认启用、暂停/恢复、立即执行、删除及最近 10 次执行记录。卡片将“计划详情”和“执行记录”分开:详情页管理计划,记录页只提供单次运行详情和状态核实;顶部轻量导航用于切换视图、刷新当前页及返回列表。只有配置的 Agent Bot 所有者可以在飞书中管理计划。计划固定绑定已有本地任务和原始回复位置,不随“当前任务”切换;执行时使用目标任务当时的 Provider、模型及权限,不 Fork、不改写历史、不自动提高权限。
|
|
331
|
+
|
|
332
|
+
CLI 复用相同服务,以 JSON 输出结果:
|
|
333
|
+
|
|
334
|
+
```powershell
|
|
335
|
+
agentbot schedule add --task <任务> --name "构建检查" --cron "0 9 * * 1-5" --timezone Asia/Singapore --prompt "检查项目构建状态"
|
|
336
|
+
agentbot schedule add --task <任务> --at "2026-12-01T10:00:00+08:00" --prompt "检查构建结果"
|
|
337
|
+
agentbot schedule list
|
|
338
|
+
agentbot schedule show <计划ID>
|
|
339
|
+
agentbot schedule history <计划ID>
|
|
340
|
+
agentbot schedule pause <计划ID>
|
|
341
|
+
agentbot schedule resume <计划ID>
|
|
342
|
+
agentbot schedule run <计划ID>
|
|
343
|
+
agentbot schedule edit <计划ID> --cron "0 10 * * 1-5" --prompt "检查项目构建状态"
|
|
344
|
+
agentbot schedule delete <计划ID>
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
创建、编辑只保存草稿,并向原会话发送确认卡片,由所有者确认后启用。Agent Bot 启动的 Agent 中,`add` 可省略 `--task`;斜杠命令支持相同操作和参数,但不接受 `--task`。Cron 使用五段格式,最小精度为分钟;`--at` 必须是含时区偏移的 ISO 时间。每个计划保存独立 IANA 时区,默认为创建时的主机时区。Prompt 最多 1000 字符,与飞书表单限制一致。`edit` 替换完整配置,不是局部修改;CLI 列表最多返回 100 项,飞书列表支持翻页。
|
|
348
|
+
|
|
349
|
+
到点后进入持久化队列,空闲时启动独立轮次,不向活跃轮次追加指令。真正开始执行时,先向计划的原会话或话题发送原始 Prompt,再发送思考卡片并提交轮次;仅排队时不发送,恢复任务和方案确认后的继续执行不重复发送。Prompt 发送失败时不提交模型,并暂停已启用的计划。同一计划最多一个待执行、执行中或状态待核实的运行,重叠触发记录为跳过。`--max-delay <分钟>` 指定从计划时间起的最晚开始时限,默认 60 分钟;提交前再次校验过期、暂停/删除、所有者、目标和安全重启状态。暂停/删除取消尚未提交的运行,不停止已经提交的任务;停止仍使用普通 Stop。立即执行不改变下一次计划时间。
|
|
350
|
+
|
|
351
|
+
重启、休眠或超过一分钟的调度延迟导致错过时间时,默认跳过,不突然补跑旧指令。`--catch-up <分钟>` 可显式允许窗口内最近一次补跑,仍受 `--max-delay` 限制;不批量重放历史。计划、执行记录、队列在同一事务中持久化并去重。已知活跃的 App Server 轮次可以重新连接;提交状态不明确或已经中断时不自动重发,核实 Agent 已结束后,可在执行记录中点击“已核实结束”解除后续调度阻塞。目标归档、所有者变化时暂停计划。安全重启期间暂停派发。主机和服务需要保持运行,不提供自动唤醒;时间为尽力调度,包含最多约 5 秒扫描延迟和排队等待,不保证硬实时。
|
|
352
|
+
|
|
300
353
|
`/file` 支持相对路径、绝对路径和以 `~` 开头的用户目录路径;相对路径以当前任务目录为基准。
|
|
301
354
|
|
|
302
355
|
`/fork` 和 `/forkgroup` 会从已完成的工作创建分支,不会中断正在执行的轮次。`/sessions` 用于跨项目、跨 Provider 管理任务,每页最多显示 10 个任务;切换 Provider 不会让任务从列表或搜索结果中消失。项目菜单提供 `New` 和 `NewGroup`。每个任务的 `SwitchGroup` 会创建新群并绑定同一个任务,保留历史、标题和运行设置,不创建新 Agent 任务,也不 fork,原会话绑定不变。若任务正在 Agent Bot 中执行,本轮回复仍留在原会话,新群发来的消息先排队;正在外部客户端执行的任务需要等待完成后再切换。展开任务后会直接显示最后一个用户 Prompt 的前 50 个字符、更新时间以及任务级操作。运行中任务还会显示独立的 `Stop` 按钮,包括当前任务、其他会话和外部客户端中的任务;点击发送正常的 Agent 中断信号,不切换任务、不结束进程。列表刷新保留搜索条件和页码,并根据 Agent 的实际状态保留或移除 Stop;空闲后才提供 Archive。点击 `Turns` 可查看对应任务的轮次,包括尚未绑定到 Agent Bot 的任务,不会切换当前任务;非当前任务仅供查看,需要先切换任务才能 Reset。`/turns` 用于恢复对话上下文,不会回退本地文件。
|
|
@@ -349,6 +402,8 @@ Agent Bot 将用户相关文件保存在仓库之外:
|
|
|
349
402
|
|
|
350
403
|
`/status` 状态卡片底部也提供 **Preview**,与 Refresh、Stop/Switch 放在同一行。点击可查看正在执行的轮次,空闲时则查看最近一轮;刷新卡片后会更新目标。对于尚未被 Agent Bot 记录的外部任务,打开 Preview 时会从 Agent 按需读取所选轮次并缓存完整执行详情;读取失败可刷新页面重试。没有轮次、无法读取历史且无本地记录,或文件预览服务不可用时不显示按钮。查看其他任务的状态不会切换或接管任务。
|
|
351
404
|
|
|
405
|
+
所有飞书卡片和最终回答在发送、回复、更新时共用统一图片处理链路。本地 Markdown 图片上传为可预览的飞书图片,跨卡片及刷新复用未变更的上传结果。文件缺失或上传失败时降级为文字,不影响整张卡片显示。代码示例、已有飞书图片 key 和按钮回调数据保持不变,不再要求各类卡片单独标记是否处理图片。
|
|
406
|
+
|
|
352
407
|
思考卡片底部操作区提供 `Preview` 按钮,可在浏览器中查看本轮已保存的执行时间线,采用紧凑布局并适配手机,思考块直接以内容标题作为折叠标题,展开后显示内容。只有标题而没有正文时保留普通标题行,不显示折叠箭头、不请求详情;实时更新收到正文后才变为可展开项。工具块只有一级折叠,默认只显示有意义的单行命令摘要、简短耗时(如 `58s` 或 `2:32`)和完成状态。展开后先显示以 `$` 开头的完整命令,随后直接显示结果、图片和修改文件。相同的输出和错误日志只显示一次。执行中的 Turn 会通过局部更新实时显示变化,保留手动展开状态、滚动位置和未变化的图片节点,避免图片反复加载;Token 等元数据更新不会替换时间线。折叠工具块和文件变更汇总首屏只加载摘要,展开时才请求命令、日志、图片和文件列表;再次展开复用已加载内容,运行中只刷新已展开且内容变化的详情,加载失败可点击重试。已结束的 Turn 不再建立 SSE 实时连接。“正在等待 Agent 返回进度”只在尚无可显示进度时出现,已有回答、其他可见进展或 Turn 已结束时不再显示。点击文件变更列表或工具文件列表中的文件,可在新标签页预览其当前内容;已删除或不可用的文件保留为路径文字。Turn Preview 与本地文件链接共用相同的签名、访问地址和网络范围。“最终回答”旁提供下载、复制两个图标,导出原始 Markdown(保留格式、代码块和原始链接),而非渲染后的网页内容。下载为 UTF-8 `.md` 文件;复制支持 HTTP/局域网页面的回退方式,并显示成功或失败提示。已结束页面及实时到达的最终回答均可使用。
|
|
353
408
|
|
|
354
409
|
Turn Preview 完整保留已记录的执行内容,不再反复把整轮内容写入数据库。页面按增量实时更新,折叠工具展开时加载完整详情。备份时请保留整个 Profile 数据目录,以同时保存执行记录和任务信息;已有历史仍可查看。
|
|
@@ -389,13 +444,13 @@ HTML 文件(`.html`、`.htm`)默认以预览模式打开,并支持切换
|
|
|
389
444
|
|
|
390
445
|
CSV 文件(`.csv`,不区分大小写)默认显示只读表格,带行号、列字母和固定标签,可横向及纵向滚动;首行保留为数据,不自动当作表头。支持标准逗号分隔、引号内逗号和换行、双引号转义、空单元格,以及现有 UTF-8、带 BOM 的 UTF-16、GB18030 编码识别;数字字符串和公式均按普通文本显示。预览最多读取开头 2 MiB,表格最多显示 500 条记录、50 列、每格 4000 个字符,超限或引号格式错误时明确提示,字节边界处不完整的记录不展示。代码视图最多显示 2000 个物理行,原始文件和下载保持完整内容;实时更新保留所选模式和表格滚动位置。
|
|
391
446
|
|
|
392
|
-
Provider
|
|
447
|
+
Provider、模型、思考强度和权限设置只作用于当前任务,不会在 `config.yaml` 中创建或修改 Agent 默认值。无关新任务的默认值请通过 `/settings` 的 Agent 默认值页面或显式配置 `agents.<name>.defaults` 修改。同 Agent 的 `/new` 和 `/newgroup` 仍继承源任务设置,`/fork` 和 `/forkgroup` 仍保留源任务的设置与历史。
|
|
393
448
|
|
|
394
449
|
App Server 任务切换权限时,下一轮会同时应用审批与沙箱策略:`auto` 为关闭沙箱且不弹审批,`confirm` 为工作区可写沙箱并按需审批。可在 `/permissions` 卡片中选择,或使用 `agentbot task permissions auto|confirm`。切换无需重启 Agent、Fork 或新建任务,不改变已在执行的工具进程,也不会通过追加消息(steer)修改当前轮次沙箱。工作区额外可写目录、网络访问及临时目录排除项保留 Agent 的配置。
|
|
395
450
|
|
|
396
451
|
运行设置卡片末尾以 Markdown 引用块显示当前选项页的一句重点提示,标明作用范围和生效时机。Agent 只改变本聊天或话题中新任务的默认 Agent,不迁移当前任务;模型、思考强度和权限从下一轮生效。Agent 和 Provider 选项只显示标识,去掉重复的展示名称,保留当前与默认状态标记。只有一个 Provider 时,`/provider` 仍会打开运行设置卡片,可以继续切换到 Model、Thinking 和 Permission 页。
|
|
397
452
|
|
|
398
|
-
任务正在 Agent Bot 中执行时,切换 Provider 会保存为待生效设置,不中断本轮。运行设置卡片立即显示目标 Provider 和将使用的模型,Model 页切换为该 Provider
|
|
453
|
+
任务正在 Agent Bot 中执行时,切换 Provider 会保存为待生效设置,不中断本轮。运行设置卡片立即显示目标 Provider 和将使用的模型,Model 页切换为该 Provider 的模型列表,可继续选择,以最后选择为准;此时修改思考强度和权限也一起暂存。本轮结束后、排队消息、重试或新轮次开始前实际应用,空闲任务则立即切换。待生效设置重启后保留,应用前不改动实际运行设置;应用后也不会修改 Agent 默认值。如果延迟切换失败,自动回退之前的 Provider 和模型;确认回退成功后,卡片恢复显示原设置并提示失败原因,清除待生效选择,排队消息和后续轮次继续使用原设置。只有回退也失败或无法确认时才暂停后续轮次、保留排队消息,等待重新选择恢复。对于自定义 Provider,Agent Bot 会在接口可用时读取其 OpenAI 兼容 `/models` 接口,并只展示该 Provider 返回的模型。切换时优先保留目标 Provider 也支持的原模型;否则选择目标 Provider 的默认模型,没有默认模型时选择返回列表中的第一个模型。未提供模型列表接口的 Provider 仍可使用:Agent Bot 会把当前或已配置模型作为唯一候选交给 Codex 应用。Agent Bot 校验任务 ID、Provider 和模型后才保存并提示成功。已有历史的任务切换时保留远端线程 ID 和全部历史,包括失败、中断的轮次。首次发消息前,确认没有历史、分支来源或 Goal 的空会话可通过新建底层线程切换 Provider,本地任务、群聊/话题绑定、目录和标题保持不变;新 Provider/模型及持久化成功前保留原线程,失败仍使用原会话,不发送虚构 Prompt 或改写历史。切换失败时保留原设置并尝试恢复远端;如果恢复也失败,将阻止后续执行,直到重新切换 Provider 成功。
|
|
399
454
|
|
|
400
455
|
`feishu.groupNameFormat` 可分别设置 Project 与 Projectless 新群的名称模板,支持系统、Agent、项目、任务名和日期变量。完整格式说明见[技术参考](docs/technical-reference.zh.md#配置模型)。
|
|
401
456
|
|
|
@@ -417,7 +472,7 @@ Agent Bot 启动时还会读取每个 Codex Agent 的 `CODEX_HOME/.env`(默认
|
|
|
417
472
|
|
|
418
473
|
Agent Bot 会响应机器人所在群内拥有者发送的普通消息。将 `feishu.respondToAllGroupMessages` 设为 `false` 后,还会要求拥有者在群消息中 @ 当前机器人;私聊不受这一项影响。只有开启该配置时,初始化才会申请需要手动发布的“接收所有群消息”权限。从 `false` 改为 `true` 后,需要重新运行 `agentbot init` 并完成最后的权限步骤。
|
|
419
474
|
|
|
420
|
-
|
|
475
|
+
思考卡片、执行详情和活动历史卡片只使用分组布局:辅助 Commentary 和用户追加消息保持直接显示,每个执行组只显示最新一段原生思考,点击后可展开完整的工具命令和结果。显示命令时会省略常见的 PowerShell、zsh、bash 和 sh 启动包装前缀。失败工具仍会在自己的工具面板中标记,但不会让整个执行组显示失败图标或红色边框。执行组默认折叠,并使用稳定的组件标识,使用户在飞书中手动打开的面板在卡片更新后继续保持展开。Codex 压缩上下文时,卡片内部会把实时压缩状态显示为一条进度活动;协议提供数据时,还会显示耗时、压缩前后的上下文 token 数、已执行轮次和 rollout 磁盘占用。长任务会根据完整渲染后的卡片内容大小翻页,不再使用固定的消息数或工具数。已有配置中的废弃布局字段会被忽略,保存的历史数据和网页 Preview 展示不变。
|
|
421
476
|
|
|
422
477
|
纯空白 Commentary 不占用固定展示名额。卡片生成的连续省略标记只显示一次,不会删除消息正文中的省略号,也不会改动已保存的历史记录。
|
|
423
478
|
|
|
@@ -433,7 +488,7 @@ Turn Preview 中每个已保存的思考项默认折叠,开头的 Markdown 标
|
|
|
433
488
|
|
|
434
489
|
## 常见问题
|
|
435
490
|
|
|
436
|
-
异常崩溃后,不再仅凭 Codex 日志缺少结束事件就把任务判为运行中:未加载的任务还需要确认有存活的写入进程。Agent Bot
|
|
491
|
+
异常崩溃后,不再仅凭 Codex 日志缺少结束事件就把任务判为运行中:未加载的任务还需要确认有存活的写入进程。Agent Bot 确认会话恢复成功后才显示运行状态;写锁冲突会停止自动恢复并显示占用卡片,其他尚未确认恢复成功的故障每 5 秒检查,在 1 分钟窗口耗尽后标记待核实并通知用户,不重发已提交的指令,也不会自动关闭外部进程。已经确认仍在执行的轮次继续监控,临时断连也不会被该恢复超时误判为空闲。
|
|
437
492
|
|
|
438
493
|
- **机器人没有响应:** 运行 `agentbot server status`,并查看当天的 `~/.agent-bot/logs/agent-bot.YYYY-MM-DD.log`
|
|
439
494
|
- **Node 崩溃后 Worker 被自动重启:** 查看 `~/.agent-bot/data/last-crash.json`、崩溃当天的 `~/.agent-bot/logs/worker.stderr.YYYY-MM-DD.log` 和 `~/.agent-bot/data/crash-reports/`
|
package/config.example.yaml
CHANGED
|
@@ -12,8 +12,6 @@ feishu:
|
|
|
12
12
|
project: "[{agent}] [{project}] {taskname}"
|
|
13
13
|
projectless: "[{agent}] {taskname}"
|
|
14
14
|
dateFormat: "MM-dd"
|
|
15
|
-
# Use "timeline" to temporarily restore the original thinking-card layout.
|
|
16
|
-
thinkingCardLayout: "grouped"
|
|
17
15
|
|
|
18
16
|
console:
|
|
19
17
|
enabled: true
|
|
@@ -52,7 +50,7 @@ agents:
|
|
|
52
50
|
- "--listen"
|
|
53
51
|
- "stdio://"
|
|
54
52
|
env: {}
|
|
55
|
-
#
|
|
53
|
+
# Configure explicitly here or through /settings; task settings stay task-local.
|
|
56
54
|
defaults:
|
|
57
55
|
# modelProvider: "openai"
|
|
58
56
|
# model: "gpt-5"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controlProtocol.js","sourceRoot":"","sources":["../../src/cli/controlProtocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"controlProtocol.js","sourceRoot":"","sources":["../../src/cli/controlProtocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AA2L7B,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC9C,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC/F,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO;QACjC,CAAC,CAAC,0BAA0B,GAAG,EAAE;QACjC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC;AACtE,CAAC"}
|
package/dist/cli/help.js
CHANGED
|
@@ -19,6 +19,12 @@ export function renderCliHelp(version, language = cliLanguage) {
|
|
|
19
19
|
server stop 停止 Agent Bot
|
|
20
20
|
skills status 显示内置 Skill 状态
|
|
21
21
|
skills install 安装内置 Skill
|
|
22
|
+
schedule list 列出定时计划(JSON)
|
|
23
|
+
schedule add --task <任务> --cron "0 9 * * 1-5" --prompt "检查构建" 创建待确认计划
|
|
24
|
+
schedule add --task <任务> --at <ISO时间> --prompt <提示词> 创建一次性计划
|
|
25
|
+
schedule edit <计划> <参数> 修改计划并重新确认;参数与 add 相同
|
|
26
|
+
schedule show|history <计划> 查看计划或最近运行记录
|
|
27
|
+
schedule pause|resume|run|delete <计划> 暂停、恢复、立即执行或删除
|
|
22
28
|
|
|
23
29
|
任务命令:
|
|
24
30
|
task list 列出任务;支持 --search,sessions 是别名
|
|
@@ -56,6 +62,7 @@ export function renderCliHelp(version, language = cliLanguage) {
|
|
|
56
62
|
选项:
|
|
57
63
|
--profile <目录> 使用独立的 Profile 目录
|
|
58
64
|
--config <路径> 使用指定的配置文件
|
|
65
|
+
全局配置:飞书 /settings 面板,或编辑此 YAML 文件
|
|
59
66
|
--json 在支持时输出 JSON
|
|
60
67
|
-h, --help 显示帮助
|
|
61
68
|
-v, --version 显示版本
|
|
@@ -113,6 +120,12 @@ Common commands:
|
|
|
113
120
|
server stop Stop Agent Bot
|
|
114
121
|
skills status Show the built-in Skill status
|
|
115
122
|
skills install Install the built-in Skill
|
|
123
|
+
schedule list List scheduled jobs as JSON
|
|
124
|
+
schedule add --task <task> --cron "0 9 * * 1-5" --prompt "Check build" Create a draft
|
|
125
|
+
schedule add --task <task> --at <ISO-time> --prompt <prompt> Schedule once
|
|
126
|
+
schedule edit <id> <options> Edit a draft; same options as add
|
|
127
|
+
schedule show|history <id> Inspect a plan or its recent runs
|
|
128
|
+
schedule pause|resume|run|delete <id> Manage a scheduled job
|
|
116
129
|
|
|
117
130
|
Task commands:
|
|
118
131
|
task list List tasks; supports --search; sessions is an alias
|
|
@@ -150,6 +163,7 @@ Task commands:
|
|
|
150
163
|
Options:
|
|
151
164
|
--profile <directory> Use an isolated profile directory
|
|
152
165
|
--config <path> Use a specific config file
|
|
166
|
+
Global settings: Lark /settings panel, or edit this YAML file
|
|
153
167
|
--json Print JSON when supported
|
|
154
168
|
-h, --help Show help
|
|
155
169
|
-v, --version Show version
|
package/dist/cli/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,WAAW,CAAC;AAE1D,MAAM,UAAU,aAAa,CAAC,OAAe,EAAE,QAAQ,GAAgB,WAAW;IAChF,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,aAAa,OAAO
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/cli/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,WAAW,CAAC;AAE1D,MAAM,UAAU,aAAa,CAAC,OAAe,EAAE,QAAQ,GAAgB,WAAW;IAChF,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO,aAAa,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmG9B,CAAC;IACA,CAAC;IAED,OAAO,aAAa,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmG5B,CAAC;AACF,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -30,6 +30,7 @@ import { isThreadContextKey } from "./feishu/contextKey.js";
|
|
|
30
30
|
import { refreshedSystemEnvironment } from "./supervision/systemEnvironment.js";
|
|
31
31
|
import { parseTaskCloneOptions, parseTaskForkGroupOptions, parseTaskNewOptions, parseTaskNewGroupOptions, } from "./cli/taskGroupOptions.js";
|
|
32
32
|
import { StateStore } from "./state/StateStore.js";
|
|
33
|
+
import { parseScheduleCommand } from "./scheduling/ScheduleCommand.js";
|
|
33
34
|
import { nodeDiagnosticReportArguments, prepareCrashReportDirectory, resolveSupervisorDiagnosticsPaths, } from "./supervision/SupervisorDiagnostics.js";
|
|
34
35
|
import { agentBotHome, defaultSqlitePath } from "./config/paths.js";
|
|
35
36
|
import { finalizeSelfUpdatePlan, launchSelfUpdateRunner, parseSelfUpdateOptions, prepareSelfUpdate, releaseSelfUpdatePlan, requireNpmSelfUpdateInstallation, } from "./cli/SelfUpdater.js";
|
|
@@ -80,6 +81,10 @@ async function main(input) {
|
|
|
80
81
|
await taskCommand(rest);
|
|
81
82
|
return;
|
|
82
83
|
}
|
|
84
|
+
if (command === "schedule") {
|
|
85
|
+
await scheduleCommand(rest);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
83
88
|
if (command === "skill" || command === "skills") {
|
|
84
89
|
skillsCommand(rest);
|
|
85
90
|
return;
|
|
@@ -871,6 +876,33 @@ function resolveRestartNotificationSessionId(sqlitePath, args) {
|
|
|
871
876
|
store.close();
|
|
872
877
|
}
|
|
873
878
|
}
|
|
879
|
+
async function scheduleCommand(input) {
|
|
880
|
+
if (["--help", "-h", "help"].includes(input[0] ?? "")) {
|
|
881
|
+
printHelp();
|
|
882
|
+
return;
|
|
883
|
+
}
|
|
884
|
+
const args = input.filter((argument) => argument !== "--json");
|
|
885
|
+
const config = loadConfig();
|
|
886
|
+
const store = new StateStore(config.storage.sqlitePath);
|
|
887
|
+
try {
|
|
888
|
+
let localSessionId;
|
|
889
|
+
let command;
|
|
890
|
+
if (args[0] === "add") {
|
|
891
|
+
const target = resolveTaskCommandTarget(store.listAllSessions(), args.slice(1), "schedule add");
|
|
892
|
+
localSessionId = target.session.localSessionId;
|
|
893
|
+
command = parseScheduleCommand(["add", ...target.args]);
|
|
894
|
+
}
|
|
895
|
+
else
|
|
896
|
+
command = parseScheduleCommand(args);
|
|
897
|
+
const result = controlData(await sendControlRequest(controlEndpoint(config.storage.sqlitePath), {
|
|
898
|
+
action: "schedule", command, localSessionId,
|
|
899
|
+
}, 60_000));
|
|
900
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
901
|
+
}
|
|
902
|
+
finally {
|
|
903
|
+
store.close();
|
|
904
|
+
}
|
|
905
|
+
}
|
|
874
906
|
async function taskCommand(input) {
|
|
875
907
|
const [action = "list", ...rest] = input;
|
|
876
908
|
const config = loadConfig();
|