@keyou007/agent-bot 0.1.14-alpha.1 → 0.1.14-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 +14 -1
- package/README.md +42 -12
- package/README.zh.md +42 -12
- package/config.example.yaml +1 -1
- package/dist/cli/AutostartManager.js +431 -0
- package/dist/cli/AutostartManager.js.map +1 -0
- package/dist/cli/FeishuAppConfiguration.js +17 -13
- package/dist/cli/FeishuAppConfiguration.js.map +1 -1
- package/dist/cli/Initializer.js +35 -0
- package/dist/cli/Initializer.js.map +1 -1
- package/dist/cli/SelfUpdateRunner.js +552 -0
- package/dist/cli/SelfUpdateRunner.js.map +1 -0
- package/dist/cli/SelfUpdater.js +431 -0
- package/dist/cli/SelfUpdater.js.map +1 -0
- package/dist/cli/autostartOutput.js +63 -0
- package/dist/cli/autostartOutput.js.map +1 -0
- package/dist/cli/controlProtocol.js.map +1 -1
- package/dist/cli/help.js +92 -18
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/taskGroupOptions.js +14 -11
- package/dist/cli/taskGroupOptions.js.map +1 -1
- package/dist/cli/taskListOutput.js +3 -0
- package/dist/cli/taskListOutput.js.map +1 -1
- package/dist/cli/taskTarget.js +99 -0
- package/dist/cli/taskTarget.js.map +1 -0
- package/dist/cli.js +643 -58
- package/dist/cli.js.map +1 -1
- package/dist/codex/CodexRuntime.js +8 -2
- package/dist/codex/CodexRuntime.js.map +1 -1
- package/dist/commands/CommandRouter.js +7 -1
- package/dist/commands/CommandRouter.js.map +1 -1
- package/dist/feishu/CardRenderer.js +172 -23
- package/dist/feishu/CardRenderer.js.map +1 -1
- package/dist/feishu/FeishuMarkdown.js +25 -1
- package/dist/feishu/FeishuMarkdown.js.map +1 -1
- package/dist/index.js +134 -2
- package/dist/index.js.map +1 -1
- package/dist/proxy/ProxySessionController.js +436 -12
- package/dist/proxy/ProxySessionController.js.map +1 -1
- package/dist/state/StateStore.js +18 -0
- package/dist/state/StateStore.js.map +1 -1
- package/docs/technical-reference.md +17 -7
- package/docs/technical-reference.zh.md +17 -7
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
- package/skills/agent-bot/SKILL.md +107 -188
- package/src/cli/AutostartManager.ts +579 -0
- package/src/cli/FeishuAppConfiguration.ts +22 -7
- package/src/cli/Initializer.ts +57 -0
- package/src/cli/SelfUpdateRunner.ts +817 -0
- package/src/cli/SelfUpdater.ts +688 -0
- package/src/cli/autostartOutput.ts +75 -0
- package/src/cli/controlProtocol.ts +111 -1
- package/src/cli/help.ts +92 -18
- package/src/cli/taskGroupOptions.ts +27 -17
- package/src/cli/taskListOutput.ts +10 -0
- package/src/cli/taskTarget.ts +168 -0
- package/src/cli.ts +781 -65
- package/src/codex/CodexRuntime.ts +8 -2
- package/src/commands/CommandRouter.ts +6 -1
- package/src/commands/commandTypes.ts +1 -0
- package/src/feishu/CardRenderer.ts +199 -23
- package/src/feishu/FeishuMarkdown.ts +27 -1
- package/src/index.ts +172 -2
- package/src/proxy/ProxySessionController.ts +532 -15
- package/src/runtime/types.ts +1 -0
- package/src/state/StateStore.ts +19 -0
|
@@ -1,262 +1,181 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-bot
|
|
3
|
-
description:
|
|
3
|
+
description: Use the agentbot CLI to inspect and safely manage Agent Bot, its profiles, service, tasks, groups, settings, Goals, Turns, files, and restarts. Use when running inside Agent Bot or when the user asks to initialize, inspect, control, troubleshoot, or restart Agent Bot.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Agent Bot
|
|
7
7
|
|
|
8
|
-
Use
|
|
8
|
+
Use `agentbot` as the supported control surface. The legacy `agent-bot` command is deprecated.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## What Agent Bot Is
|
|
11
11
|
|
|
12
|
-
Agent Bot
|
|
12
|
+
Agent Bot connects Feishu conversations to local coding Agents such as Codex and TraeX. Each Agent Bot task keeps its own Agent, project directory, conversation context, and execution settings, so work can continue from Feishu without direct access to the host computer.
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
if ($env:AGENT_BOT -eq "1") { "running in Agent Bot" }
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
```sh
|
|
19
|
-
if [ "${AGENT_BOT:-}" = "1" ]; then echo "running in Agent Bot"; fi
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
```js
|
|
23
|
-
const runningInAgentBot = process.env.AGENT_BOT === "1";
|
|
24
|
-
```
|
|
14
|
+
Source code: https://github.com/keyou/agent-bot
|
|
25
15
|
|
|
26
|
-
|
|
27
|
-
import os
|
|
16
|
+
Use Agent Bot when the user wants to:
|
|
28
17
|
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
- Continue or monitor a local Agent task from Feishu.
|
|
19
|
+
- Keep work for different projects or conversations separate.
|
|
20
|
+
- Create a fresh task or fork completed context into parallel work.
|
|
21
|
+
- Change an Agent, model, reasoning level, permission mode, Goal, or queued Prompt.
|
|
22
|
+
- Browse task files, send a file to Feishu, or run a command in the task directory.
|
|
23
|
+
- Inspect, restart, initialize, or troubleshoot the Agent Bot service.
|
|
31
24
|
|
|
32
|
-
|
|
25
|
+
## Detect Agent Bot
|
|
33
26
|
|
|
34
|
-
Agent Bot
|
|
27
|
+
Agent Bot sets `AGENT_BOT=1` for every Agent process it starts. Treat that exact value as authoritative:
|
|
35
28
|
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
AGENT_BOT_CONFIG
|
|
39
|
-
AGENT_BOT_AGENT_NAME
|
|
40
|
-
AGENT_BOT_LARK_APP_ID
|
|
41
|
-
AGENT_BOT_LARK_BOT_OPEN_ID
|
|
42
|
-
AGENT_BOT_LARK_USER_OPEN_ID
|
|
29
|
+
```powershell
|
|
30
|
+
$env:AGENT_BOT -eq "1"
|
|
43
31
|
```
|
|
44
32
|
|
|
45
|
-
|
|
33
|
+
Do not infer Agent Bot execution from an installed CLI, a running service, or the presence of `~/.agent-bot`.
|
|
46
34
|
|
|
47
|
-
##
|
|
35
|
+
## Work Safely
|
|
48
36
|
|
|
49
|
-
When
|
|
37
|
+
When running inside Agent Bot:
|
|
50
38
|
|
|
51
|
-
-
|
|
52
|
-
-
|
|
39
|
+
- Use `agentbot` commands instead of killing workers, supervisors, or child processes.
|
|
40
|
+
- When hosted by Agent Bot, omit the task target to act on the current task. Use `--task <task>` only to target another task explicitly.
|
|
41
|
+
- Use the same `--profile <directory>` on every command when managing an isolated profile.
|
|
42
|
+
- Prefer `--json` when another tool or Agent will consume the output.
|
|
43
|
+
- Do not edit the Agent Bot SQLite database or runtime files directly.
|
|
44
|
+
- Verify code changes before scheduling a restart.
|
|
53
45
|
|
|
54
|
-
##
|
|
55
|
-
|
|
56
|
-
Run initialization once after installing or linking the CLI:
|
|
46
|
+
## Inspect First
|
|
57
47
|
|
|
58
48
|
```powershell
|
|
59
|
-
agentbot
|
|
49
|
+
agentbot --version
|
|
50
|
+
agentbot server status
|
|
51
|
+
agentbot task current --json
|
|
52
|
+
agentbot task list
|
|
60
53
|
```
|
|
61
54
|
|
|
62
|
-
|
|
55
|
+
`task current` shows details, but other `task` commands resolve the invoking task automatically. If automatic resolution fails, use an explicit ID from `task list` with `--task <task>`.
|
|
63
56
|
|
|
64
|
-
|
|
57
|
+
Task references may be a list number, a full task ID, or an unambiguous ID prefix.
|
|
65
58
|
|
|
66
|
-
|
|
59
|
+
## Manage Tasks
|
|
67
60
|
|
|
68
|
-
|
|
61
|
+
Use these common commands:
|
|
69
62
|
|
|
70
|
-
|
|
63
|
+
```powershell
|
|
64
|
+
agentbot task status
|
|
65
|
+
agentbot task prompt "<prompt>"
|
|
66
|
+
agentbot task queue "<prompt>"
|
|
67
|
+
agentbot task stop
|
|
68
|
+
agentbot task archive
|
|
69
|
+
agentbot task title "<title>"
|
|
70
|
+
```
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
- `prompt` posts the Prompt to the task's Feishu conversation before submitting it.
|
|
73
|
+
- `queue` creates a later turn instead of steering the active turn. `nosteer` is an alias.
|
|
74
|
+
- `stop` requests an Agent interrupt; it does not kill the Agent process.
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
Create or branch work in the same conversation:
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
```powershell
|
|
79
|
+
agentbot task new [title] [--agent <name>] [--dir <cwd> | --nodir]
|
|
80
|
+
agentbot task fork
|
|
81
|
+
agentbot task switch [target-task]
|
|
82
|
+
```
|
|
77
83
|
|
|
78
|
-
|
|
84
|
+
Create a separate Feishu group:
|
|
79
85
|
|
|
80
|
-
|
|
86
|
+
```powershell
|
|
87
|
+
agentbot task newgroup [title] [--agent <name>] [--dir <cwd> | --nodir]
|
|
88
|
+
agentbot task forkgroup [title]
|
|
89
|
+
```
|
|
81
90
|
|
|
82
|
-
|
|
91
|
+
Choose `new` or `newgroup` for fresh context. Choose `fork` or `forkgroup` when the new task must retain conversation history through the latest completed Turn. Forking must not interrupt an active source turn.
|
|
83
92
|
|
|
84
|
-
|
|
93
|
+
## Change Settings
|
|
85
94
|
|
|
86
95
|
```powershell
|
|
87
|
-
agentbot
|
|
88
|
-
agentbot
|
|
96
|
+
agentbot task agent [name]
|
|
97
|
+
agentbot task provider [provider]
|
|
98
|
+
agentbot task model [model]
|
|
99
|
+
agentbot task thinking [effort]
|
|
100
|
+
agentbot task permissions [auto|confirm]
|
|
89
101
|
```
|
|
90
102
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
## Start with inspection
|
|
103
|
+
Omit the value to inspect the current setting and available choices. `agent` changes the default Agent for future tasks in that conversation. The other settings affect the specified task from its next request.
|
|
94
104
|
|
|
95
|
-
|
|
105
|
+
## Goals And Turns
|
|
96
106
|
|
|
97
107
|
```powershell
|
|
98
|
-
agentbot
|
|
99
|
-
agentbot
|
|
100
|
-
agentbot
|
|
101
|
-
agentbot task
|
|
108
|
+
agentbot task goal
|
|
109
|
+
agentbot task goal "<objective>"
|
|
110
|
+
agentbot task goal pause|resume|clear
|
|
111
|
+
agentbot task goal edit "<objective>"
|
|
112
|
+
agentbot task turns
|
|
113
|
+
agentbot task reset <turn-id>
|
|
102
114
|
```
|
|
103
115
|
|
|
104
|
-
|
|
116
|
+
Use `turns` to obtain a real Turn ID before `reset`. Reset changes conversation context only; it does not revert local files.
|
|
105
117
|
|
|
106
|
-
|
|
118
|
+
## Files And Local Commands
|
|
107
119
|
|
|
108
|
-
|
|
120
|
+
```powershell
|
|
121
|
+
agentbot task dir [directory]
|
|
122
|
+
agentbot task file <path>
|
|
123
|
+
agentbot task shell "<command>"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Paths are resolved from the selected task's working directory; `~` means the operating-system user's home directory. `file` sends the file to the task's Feishu conversation. `shell` runs in the task directory.
|
|
109
127
|
|
|
110
|
-
|
|
128
|
+
For group mention-only mode:
|
|
129
|
+
|
|
130
|
+
```powershell
|
|
131
|
+
agentbot task mute on|off
|
|
132
|
+
```
|
|
111
133
|
|
|
112
|
-
|
|
134
|
+
## Manage The Service
|
|
113
135
|
|
|
114
136
|
```powershell
|
|
115
137
|
agentbot server start
|
|
116
138
|
agentbot server status
|
|
117
|
-
agentbot server
|
|
139
|
+
agentbot server autostart enable|status|disable
|
|
140
|
+
agentbot update --task <task>
|
|
141
|
+
agentbot server restart --task <task> --reason "<reason>"
|
|
118
142
|
agentbot server stop
|
|
119
143
|
```
|
|
120
144
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
When scheduling from an Agent Bot-hosted task, pass `--task <current-task-id>`. This adds the task's exact Lark conversation, including its topic, to the pending restart's notification set. Every conversation that triggers the same pending restart plus every conversation active during the previous minute receives its own status card and restarting acknowledgement. Once enrolled, a route remains in the set until that restart ends; repeated routes are deduplicated. Resolve the current ID with `agentbot task list --status running` when necessary. If `--task` is omitted, the Server infers a target only when all running tasks belong to one conversation and rejects the request when multiple running conversations make ownership ambiguous. Startup cards are service-wide notices: every known private chat receives one on every startup, groups receive one when active in the previous minute or enrolled for the current safe restart, and topic routes receive the card in their parent group rather than inside the topic.
|
|
124
|
-
|
|
125
|
-
On Windows, initial start, safe or immediate replacement, and every crash-driven Worker launch reload the latest Machine and User environment variables. After changing `PATH` or installing a CLI shim, finish the current work and use the normal restart path. Agent Bot keeps `AGENT_BOT_*` and `FEISHU_*` process-local so Profile selection and bot credentials do not leak between isolated instances.
|
|
126
|
-
|
|
127
|
-
In Feishu, `/restart` schedules the same safe restart. Use `/restart --force` only when the user explicitly accepts interruption; the command accepts no other arguments.
|
|
128
|
-
|
|
129
|
-
Use `agentbot server restart --immediate` only when the user explicitly requests an immediate restart or accepts interruption. Never use `taskkill`, `Stop-Process`, or equivalent commands for routine Agent Bot restart management.
|
|
145
|
+
`update` is only for npm-installed Agent Bot packages. It verifies the new package before waiting for a safe service stop and automatically restores the prior version if activation fails. It refuses source checkouts and `npm link` installations.
|
|
130
146
|
|
|
131
|
-
`
|
|
147
|
+
Autostart is Profile-specific. Use `server autostart enable` for login startup, `server autostart enable --linger` on Linux only when the user explicitly requests startup before login, and `server autostart disable` to remove registration without stopping the current Server. Disabling Agent Bot autostart must not disable Linux user lingering because other services may use it.
|
|
132
148
|
|
|
133
|
-
|
|
149
|
+
Use safe restart by default. Prefer `agentbot task restart` when hosted so the current task is resolved automatically. Use `--immediate` or `task restart --force` only when the user explicitly accepts interruption.
|
|
134
150
|
|
|
135
|
-
|
|
136
|
-
- `logs/supervisor.log` for the restart timeline
|
|
137
|
-
- `logs/worker.stderr.log` for Node/V8 fatal output
|
|
138
|
-
- `data/crash-reports/report.*.json` for Node diagnostic reports
|
|
151
|
+
Never use `taskkill`, `Stop-Process`, or equivalent commands for routine restart management.
|
|
139
152
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
## Manage tasks
|
|
143
|
-
|
|
144
|
-
List tasks before resolving a numeric reference because task numbers follow the current list order:
|
|
153
|
+
## Initialize And Select Profiles
|
|
145
154
|
|
|
146
155
|
```powershell
|
|
147
|
-
agentbot
|
|
148
|
-
agentbot
|
|
149
|
-
agentbot
|
|
150
|
-
agentbot task status <number-or-task-id>
|
|
151
|
-
agentbot task stop <number-or-task-id>
|
|
152
|
-
agentbot task title <number-or-task-id> <new-title>
|
|
153
|
-
agentbot task prompt <number-or-task-id> <prompt>
|
|
154
|
-
agentbot task newgroup <number-or-task-id> [title] [--agent <standard-name>] [--dir <cwd> | --nodir] [--json]
|
|
155
|
-
agentbot task forkgroup <number-or-task-id> [title] [--json]
|
|
156
|
+
agentbot init
|
|
157
|
+
agentbot --profile ~/.agent-bot-rescue init
|
|
158
|
+
agentbot --profile ~/.agent-bot-rescue server status
|
|
156
159
|
```
|
|
157
160
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
Read all task identity fields from `task list`: every entry shows its Agent and `AgentBot task ID`; App Server tasks also show `App Server thread ID`, while ACP tasks show `ACP session ID`. The status, title, conversation context, and update time remain visible. The CLI reads `CODEX_THREAD_ID` for Codex and `TRAECLI_THREAD_ID` for TraeX; when the available native Thread IDs identify one task, it marks that entry as `Current`. Use `task current` to print that task's details directly. Use any displayed full ID or an unambiguous prefix as a task reference. With `--json`, read the local and native values from `localSessionId`, `remoteSessionId`, and `acpSessionId`.
|
|
161
|
-
|
|
162
|
-
Use `task chat <number-or-task-id>` to read the Feishu chat ID associated with a task from local routing state. Plain output is only the chat ID for scripting. Add `--json` to include the stable task ID, complete context key, and the thread ID for a topic-bound task. This read-only command does not require the Agent Bot server to be running.
|
|
163
|
-
|
|
164
|
-
Use `task prompt` to send input to a specific task without changing any chat's current task. The bot first posts the Prompt text to the task's existing Feishu chat, thread, or private-chat route, then submits it to the task. If posting fails, the task is not started or steered. The thinking card and final response continue to the same route; the command line only reports whether the Prompt was accepted.
|
|
165
|
-
|
|
166
|
-
### Create or fork a group from the CLI
|
|
161
|
+
Initialization prepares configuration, checks supported Agents, configures Feishu, and starts the server. On first initialization and `init --reset`, let the user choose whether all group messages are accepted or an explicit @ mention is required; only the first choice requests the additional all-group-message permission. Relay authorization links and wait for the user; never choose a response mode, skip authorization, or choose maintenance actions without permission.
|
|
167
162
|
|
|
168
|
-
|
|
163
|
+
Use `init --reset` only for an explicitly requested full reset and always with an explicit `--profile`. It preserves backups under `.reset-backups`.
|
|
169
164
|
|
|
170
|
-
|
|
171
|
-
- Use **Fork Group** to continue or parallelize work with the source task's conversation through a completed turn. Preserve that context in a separate private Lark group.
|
|
165
|
+
## After Code Changes
|
|
172
166
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
When creating or forking from the task that is currently running this Skill, run `agentbot task current --json` first and pass its `localSessionId` as `<number-or-task-id>`. The command resolves Codex through `CODEX_THREAD_ID` and TraeX through `TRAECLI_THREAD_ID`, while preferring the only running match when another Agent's variable was inherited from a parent process. If the command cannot identify one task, ask for an explicit AgentBot task ID instead of guessing from list order, title, or project directory.
|
|
176
|
-
|
|
177
|
-
List tasks first, identify the intended source explicitly, then run one of these commands:
|
|
167
|
+
Run the relevant checks, then build:
|
|
178
168
|
|
|
179
169
|
```powershell
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
agentbot task newgroup <number-or-task-id> "Review"
|
|
184
|
-
|
|
185
|
-
# Fresh task: override the inherited project directory.
|
|
186
|
-
agentbot task newgroup <number-or-task-id> "Review" --dir ~/dev/project
|
|
187
|
-
|
|
188
|
-
# Fresh task: use a Projectless App Server workspace.
|
|
189
|
-
agentbot task newgroup <number-or-task-id> "Question" --nodir
|
|
190
|
-
|
|
191
|
-
# Fresh task: use another configured Agent and that Agent's defaults.
|
|
192
|
-
agentbot task newgroup <number-or-task-id> "Review" --agent traex
|
|
193
|
-
|
|
194
|
-
# Context-preserving branch from the source task.
|
|
195
|
-
agentbot task forkgroup <number-or-task-id> "Parallel review"
|
|
170
|
+
npm run typecheck
|
|
171
|
+
npm test
|
|
172
|
+
npm run build
|
|
196
173
|
```
|
|
197
174
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
- Treat `<number-or-task-id>` as the source context; never substitute the shell's current working directory for its project directory.
|
|
201
|
-
- With neither `--dir` nor `--nodir`, inherit the source project. If it is Projectless, create a fresh Projectless workspace rather than reusing its generated directory.
|
|
202
|
-
- Resolve `~`, `~/...`, and `~\...` in `--dir <cwd>` from the user's home directory. Reject combining `--dir` with `--nodir`.
|
|
203
|
-
- Allow `--nodir` only for an App Server Agent.
|
|
204
|
-
- With no `--agent`, inherit the source Agent, Provider, model, reasoning effort, and permission mode. With `--agent <standard-name>`, preserve the selected project shape but use the selected Agent's runtime defaults. `--agent` is a CLI-only New Group option.
|
|
205
|
-
|
|
206
|
-
Apply these Fork Group rules:
|
|
207
|
-
|
|
208
|
-
- Fork the latest available completed turn and preserve its conversation context. Never include or interrupt a newer active turn. Reject the request when no completed turn is available.
|
|
209
|
-
- Keep the source Agent, project, Provider, model, reasoning effort, and permission mode. Fork Group does not accept Agent or project overrides; use New Group when those must change.
|
|
210
|
-
- Use the optional title as the destination task title and group suffix.
|
|
211
|
-
|
|
212
|
-
Require a running Server for either CLI command. Require `FEISHU_USER_OPEN_ID` so the Server can invite the saved authorizing user; the CLI has no Lark operator identity of its own. Add `--json` when the caller needs `group.chatId`, `group.contextKey`, or the created task IDs.
|
|
213
|
-
|
|
214
|
-
Name a New Group without an explicit title as `[agent] [project directory] 新任务 (mm-dd)`, or `[agent] 新任务 (mm-dd)` when Projectless. Name an untitled Fork Group with the source task's persistent `source title(分支 N)` sequence, without a date suffix. Cap the displayed Lark group name at 60 characters by truncating only the group title portion; preserve the complete Agent Bot task title. Do not automatically send a Sessions or Status card to the destination group. Send a welcome message that reports Provider, model, reasoning effort, and permission mode.
|
|
215
|
-
|
|
216
|
-
Give every created group a deterministic scheme-C Identicon avatar. Display the first word for Latin project names or up to four characters for Chinese names, and hash the normalized full project path into the palette and symmetric node pattern. Use the title as the stable seed for Projectless groups. Replace the user's home prefix with `~` in the group-name project segment. Limit that segment to 15 characters, preferring the final two directories, then the final directory, and only then tail truncation. Use `\` on Windows and `/` on macOS/Linux.
|
|
217
|
-
|
|
218
|
-
Use `/queue <prompt>` in Feishu to persist a separate follow-up Prompt instead of steering the active turn. Queued Prompts run in FIFO order after the current turn completes and survive Agent Bot restarts. `/nosteer <prompt>` is an equivalent compatibility spelling.
|
|
219
|
-
|
|
220
|
-
Topics created from a persisted Agent Bot user message, thinking card, or final response automatically fork that source turn on first use. A topic whose root or parent cannot be mapped to a persisted Agent Bot turn starts independently, including topics that quote ordinary messages, command replies, or error messages: its first ordinary Prompt creates a fresh task, `/new` explicitly creates one, and `/status` reports the empty topic without requiring a fork anchor. Explicit `/forkgroup` still requires a valid source turn when the topic has no bound task.
|
|
221
|
-
|
|
222
|
-
For a long-running objective in the active Feishu task, use `/goal <objective>`. Use `/goal` to inspect it, `/goal pause` or `/goal resume` to control automatic continuation, `/goal edit <objective>` to revise it, and `/goal clear` to remove it. Stopping a Goal turn through Agent Bot also pauses the Goal before sending Interrupt so it does not immediately continue.
|
|
223
|
-
|
|
224
|
-
Use `/agent` in Feishu to open the unified execution-settings card on its Agent tab and `/agent <name>` to directly select the default agent. The Agent tab is present only when multiple agents are configured and remains usable before the chat has a current task. When only one Agent is configured, `/agent` reports that current Agent directly instead of sending a card. Agent selection affects future tasks and does not replace the Agent of an existing task; use `/new` after selecting when a new task is needed.
|
|
225
|
-
|
|
226
|
-
Use `/new [title] --nodir` to force a new App Server Projectless task even when the current task belongs to a project. `--nodir` and `--dir <cwd>` are mutually exclusive; omitting both preserves the normal project-shape inheritance behavior.
|
|
227
|
-
|
|
228
|
-
Use `/dir [path]` in Feishu to open the local file browser with 15 entries per page. Without a path it starts in the current task directory; resolve relative paths from that directory and `~` from the operating-system user's home directory. Directory names navigate within the same card, while file names upload and send the selected file to the current conversation. On Windows, selecting `..` at a drive root opens the virtual drive list. Every visible directory, including the current directory, has `New` and `NewGroup` actions: `New` behaves like `/new --dir <selected-directory>`, while `NewGroup` behaves like `/newgroup --dir <selected-directory>`, including Agent and execution-setting inheritance. `Previous` and `Next` update the existing card instead of sending another browser card.
|
|
229
|
-
|
|
230
|
-
The Feishu `/sessions` card is titled `任务列表`, groups tasks by project, and shows ten compact, collapsed task rows per page. Each project row has `New` and `NewGroup`; they inherit the current, active, or most recent task in that project and create work in the same project directory. Click a task row to expand its status, Agent, task ID, directory, and task-level actions. `Previous` and `Next` update the same card; they never expand earlier pages into one long card. `Fork` switches the current chat to a branch, while `ForkGroup` binds the branch to a newly created private group; both fork actions use the selected task's latest available completed turn without interrupting an active turn.
|
|
231
|
-
|
|
232
|
-
Use `/fork [number-or-task-id]` in Feishu to branch from the current or specified App Server task and switch to the new branch. If the source task is running, Agent Bot forks from its latest completed turn and leaves the active turn running; it rejects only when the task has no completed turn yet. Every fork request sends `excludeTurns: true` to the App Server so the response omits populated turns without removing turns from the forked history. Older App Servers that explicitly reject this experimental field are retried once without it; ambiguous failures such as timeouts or disconnects are not retried.
|
|
233
|
-
|
|
234
|
-
Successfully completed Feishu thinking cards include a bottom `Reset` action followed by its compact warning. `/turns` opens the current task's completed-turn history with the Reset-effect warning at the top and 10 turns per page. It renders each entry as an indented numbered node in a commit graph whose lanes follow persisted parent turns, including Reset branches and merges across page boundaries. A successful Reset refreshes that card in place, moves the current marker to the selected turn, and sends a confirmation containing the target Prompt summary, completion time, and Turn ID. Reset forks the selected turn's original App Server thread through that turn and replaces the current task's remote thread binding in place, preserving the local task ID, title, Agent, project directory, execution settings, and chat route. Completed snapshots after the selected point remain visible together with later turns from the new branch. Reset is available only when the card still belongs to the current task and the task is idle. It restores conversation context only and never reverts local files.
|
|
235
|
-
|
|
236
|
-
Feishu thinking cards use `feishu.thinkingCardLayout: grouped` by default. The grouped layout keeps Commentary and user steering visible and groups native reasoning and tools until the next Commentary. Execution panels default to collapsed and retain stable component IDs so Feishu can preserve a user's manual expansion across updates. Long turns paginate complete rendered tool panels from the newest end according to their UTF-8 JSON size and component count, not fixed message or tool counts; grouped history retains all stored native reasoning, commands, results, and images. Use `timeline` only as a temporary rollback to the unchanged original layout and its 40-activity pages.
|
|
237
|
-
|
|
238
|
-
Status cards include a `Refresh` action that reads the latest task state and updates the same card in place without switching tasks or sending another card.
|
|
239
|
-
|
|
240
|
-
Use `/agent`, `/provider`, `/model`, `/thinking`, or `/permissions` in Feishu to open the same interactive Card 2.0 execution-settings card with the corresponding tab active. The card exposes Provider, Model, Thinking, and Permission tabs whenever a current task exists, plus an Agent tab when multiple agents are configured. Each non-current option has an English `Switch` action. Selecting an option refreshes the same card in place. Agent changes affect future tasks; the other settings apply from the next request. Model changes automatically choose a compatible reasoning effort when necessary.
|
|
241
|
-
|
|
242
|
-
If the current runtime has no alternative Provider, `/provider` reports the current Provider directly instead of opening the settings card. Apply the same rule to `/agent` when only one Agent is configured.
|
|
243
|
-
|
|
244
|
-
These four settings commands do not accept arguments. Never instruct a user to send a Provider, model, reasoning effort, or permission value after the command; direct them to the card callbacks instead.
|
|
245
|
-
|
|
246
|
-
Keep action labels placed to the right of card content or at the bottom of a card in English. Buttons above the main card content, such as activity-history navigation, may remain in Chinese.
|
|
247
|
-
|
|
248
|
-
Messages whose trimmed text starts with `/` are always parsed as Agent Bot commands. Command names accept unique prefixes, such as `/sess` for `/sessions`. Compound commands also accept registered initialisms: `/fg` for `/forkgroup`, `/ng` for `/newgroup`, and `/ns` for `/nosteer`. Exact command names take priority; ambiguous matches are rejected and list every matching command. Unknown slash commands are reported to the user with a `/help` hint and must never fall through to the model, including slash-prefixed messages that also contain images.
|
|
249
|
-
|
|
250
|
-
When a group body has a current task, renaming the Feishu group to `[agent-name] [project directory] new title` also renames that current task if the Agent prefix matches the task's configured agent. Only `new title` is written to the task; the Agent and project-directory prefixes remain group metadata. The older `[agent-name] new title` shape remains supported. Malformed names, agent mismatches, empty groups, and thread-specific tasks are ignored.
|
|
251
|
-
|
|
252
|
-
Use `--context <key>` or `--status <status>` to narrow `task list`. Use `--profile <directory>` before the command when controlling an isolated Agent Bot instance, or `--config <path>` for only a non-default configuration.
|
|
253
|
-
|
|
254
|
-
## Apply code changes safely
|
|
255
|
-
|
|
256
|
-
After changing Agent Bot code, run the relevant tests, typecheck, and build. If a running service must pick up the result, schedule:
|
|
175
|
+
If the running service must load the changes, schedule a safe restart only after verification:
|
|
257
176
|
|
|
258
177
|
```powershell
|
|
259
|
-
agentbot
|
|
178
|
+
agentbot task restart --reason "<brief reason>"
|
|
260
179
|
```
|
|
261
180
|
|
|
262
|
-
|
|
181
|
+
Use `agentbot --help` for less common options and command details.
|