@keyou007/agent-bot 0.1.24-alpha.4 → 0.1.24-alpha.6
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 +59 -0
- package/README.md +42 -6
- package/README.zh.md +42 -6
- package/SECURITY.md +12 -0
- package/config.example.yaml +5 -0
- package/dist/cli/controlProtocol.js.map +1 -1
- package/dist/cli/serverStatus.js +1 -0
- package/dist/cli/serverStatus.js.map +1 -1
- package/dist/cli.js +6 -1
- package/dist/cli.js.map +1 -1
- package/dist/codex/AppServerPermissions.js +34 -0
- package/dist/codex/AppServerPermissions.js.map +1 -0
- package/dist/codex/CodexLocalActivityDetector.js +37 -5
- package/dist/codex/CodexLocalActivityDetector.js.map +1 -1
- package/dist/codex/CodexRuntime.js +238 -127
- package/dist/codex/CodexRuntime.js.map +1 -1
- package/dist/codex/ProviderSwitch.js +12 -13
- package/dist/codex/ProviderSwitch.js.map +1 -1
- package/dist/codex/ThreadWriterProcess.js +19 -5
- package/dist/codex/ThreadWriterProcess.js.map +1 -1
- package/dist/config/AgentExecutionDefaultsStore.js +4 -0
- package/dist/config/AgentExecutionDefaultsStore.js.map +1 -1
- package/dist/config/loadConfig.js +4 -0
- package/dist/config/loadConfig.js.map +1 -1
- package/dist/config/schema.js +3 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/feishu/CardRenderer.js +146 -72
- package/dist/feishu/CardRenderer.js.map +1 -1
- package/dist/feishu/FeishuConnector.js +1 -0
- package/dist/feishu/FeishuConnector.js.map +1 -1
- package/dist/feishu/FeishuTurnPresenter.js +121 -17
- package/dist/feishu/FeishuTurnPresenter.js.map +1 -1
- package/dist/index.js +43 -6
- package/dist/index.js.map +1 -1
- package/dist/local-files/CsvPreview.js +148 -0
- package/dist/local-files/CsvPreview.js.map +1 -0
- package/dist/local-files/LocalFileViewerServer.js +104 -14
- package/dist/local-files/LocalFileViewerServer.js.map +1 -1
- package/dist/local-files/TurnPreviewPage.js +128 -12
- package/dist/local-files/TurnPreviewPage.js.map +1 -1
- package/dist/presentation/TurnStateReducer.js +80 -6
- package/dist/presentation/TurnStateReducer.js.map +1 -1
- package/dist/proxy/ProxySessionController.js +767 -260
- package/dist/proxy/ProxySessionController.js.map +1 -1
- package/dist/proxy/SessionOperationQueue.js +14 -0
- package/dist/proxy/SessionOperationQueue.js.map +1 -0
- package/dist/runtime/AcpRuntimeAdapter.js +4 -2
- package/dist/runtime/AcpRuntimeAdapter.js.map +1 -1
- package/dist/state/StateStore.js +22 -0
- package/dist/state/StateStore.js.map +1 -1
- package/dist/state/TurnPreviewJournal.js +19 -7
- package/dist/state/TurnPreviewJournal.js.map +1 -1
- package/dist/state/migrations.js +6 -0
- package/dist/state/migrations.js.map +1 -1
- package/dist/supervision/SafeRestartNotifier.js +1 -0
- package/dist/supervision/SafeRestartNotifier.js.map +1 -1
- package/dist/supervision/SafeRestartScheduler.js +19 -6
- package/dist/supervision/SafeRestartScheduler.js.map +1 -1
- package/dist/terminal/TerminalCards.js +13 -0
- package/dist/terminal/TerminalCards.js.map +1 -0
- package/dist/terminal/TerminalLinks.js +76 -0
- package/dist/terminal/TerminalLinks.js.map +1 -0
- package/dist/terminal/TerminalPage.js +212 -0
- package/dist/terminal/TerminalPage.js.map +1 -0
- package/dist/terminal/TerminalProcess.js +71 -0
- package/dist/terminal/TerminalProcess.js.map +1 -0
- package/dist/terminal/TerminalServer.js +639 -0
- package/dist/terminal/TerminalServer.js.map +1 -0
- package/docs/technical-reference.md +53 -3
- package/docs/technical-reference.zh.md +52 -2
- package/npm-shrinkwrap.json +55 -5
- package/package.json +11 -4
- package/skills/agent-bot/SKILL.md +15 -2
- package/src/cli/controlProtocol.ts +2 -1
- package/src/cli/serverStatus.ts +1 -0
- package/src/cli.ts +6 -1
- package/src/codex/AppServerPermissions.ts +39 -0
- package/src/codex/CodexLocalActivityDetector.ts +34 -4
- package/src/codex/CodexRuntime.ts +243 -139
- package/src/codex/ProviderSwitch.ts +11 -12
- package/src/codex/ThreadWriterProcess.ts +17 -9
- package/src/config/AgentExecutionDefaultsStore.ts +2 -0
- package/src/config/loadConfig.ts +4 -0
- package/src/config/schema.ts +5 -1
- package/src/feishu/CardRenderer.ts +159 -72
- package/src/feishu/FeishuConnector.ts +1 -0
- package/src/feishu/FeishuTurnPresenter.ts +108 -16
- package/src/feishu/types.ts +1 -0
- package/src/index.ts +44 -7
- package/src/local-files/CsvPreview.ts +132 -0
- package/src/local-files/LocalFileViewerServer.ts +102 -15
- package/src/local-files/TurnPreviewPage.ts +131 -13
- package/src/presentation/TurnStateReducer.ts +87 -7
- package/src/presentation/turnViewTypes.ts +9 -0
- package/src/proxy/ProxySessionController.ts +762 -259
- package/src/proxy/SessionOperationQueue.ts +13 -0
- package/src/runtime/AcpRuntimeAdapter.ts +5 -3
- package/src/runtime/types.ts +10 -3
- package/src/state/StateStore.ts +38 -1
- package/src/state/TurnPreviewJournal.ts +19 -7
- package/src/state/migrations.ts +6 -0
- package/src/supervision/SafeRestartNotifier.ts +1 -0
- package/src/supervision/SafeRestartScheduler.ts +18 -6
- package/src/terminal/TerminalCards.ts +18 -0
- package/src/terminal/TerminalLinks.ts +61 -0
- package/src/terminal/TerminalPage.ts +213 -0
- package/src/terminal/TerminalProcess.ts +71 -0
- package/src/terminal/TerminalServer.ts +513 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerminalServer.js","sourceRoot":"","sources":["../../src/terminal/TerminalServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAClF,OAAO,EAAE,MAAM,SAAS,CAAC;AAIzB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAChD,OAAO,EAAE,CAAC,EAAE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,7 @@ Turn Preview uses the existing highlight.js dependency to highlight explicitly l
|
|
|
211
211
|
|
|
212
212
|
Input attachments are stored as optional `promptImagePaths` on `TurnViewState` and `localImagePaths` on user activities, separate from bounded display text. Pending-Turn promotion, steering/reconciliation, queued starts, and snapshot recovery retain these paths. Preview resolves them through the existing signed file service with `raw=1`; missing files get a placeholder. The additive JSON fields require no database migration, and historical user activities without paths are not backfilled.
|
|
213
213
|
|
|
214
|
-
Turn Preview recognizes `mermaid` and `flowchart` fences in Prompt, Commentary, and answer Markdown. The browser lazy-loads the pinned Mermaid distribution from the same-origin `/assets/mermaid.js` endpoint (respecting `fileViewer.publicBaseUrl` prefixes), not a CDN. Strict security mode disables HTML labels and interactive callbacks; frontmatter/config directives and sources over 50,000 characters are rejected, and graphs are capped at 500 edges. Rendered SVG has active elements and external links removed; the existing viewer CSP remains unchanged. Each block defaults to Preview with width fitting, keeps its selected mode, fit/actual-size choice, and unchanged SVG across SSE updates, and shows escaped source when loading or rendering fails. SVG width is capped by both its viewBox width and its container width, preserving aspect ratio and avoiding enlargement. Narrow/touch screens cap the preview at 480 px or 55 svh (55 vh fallback); long diagrams scroll vertically. Actual size restores the viewBox width with block-local scrolling, while Fit resets the block scroll position. CSS sizing adapts to orientation changes without re-rendering Mermaid. Ordinary code blocks and tool output remain unchanged.
|
|
214
|
+
Turn Preview recognizes `mermaid` and `flowchart` fences in Prompt, Commentary, and answer Markdown. Markdown file previews reuse the same renderer, controls, sizing rules, and security policy; full-file Code view and raw/download content remain unchanged. File updates retain matching diagram nodes, modes, sizes, and scroll positions, re-rendering only changed sources. The browser lazy-loads the pinned Mermaid distribution from the same-origin `/assets/mermaid.js` endpoint (respecting `fileViewer.publicBaseUrl` prefixes), not a CDN. Strict security mode disables HTML labels and interactive callbacks; frontmatter/config directives and sources over 50,000 characters are rejected, and graphs are capped at 500 edges. Rendered SVG has active elements and external links removed; the existing viewer CSP remains unchanged. Each block defaults to Preview with width fitting, keeps its selected mode, fit/actual-size choice, and unchanged SVG across SSE updates, and shows escaped source when loading or rendering fails. SVG width is capped by both its viewBox width and its container width, preserving aspect ratio and avoiding enlargement. Narrow/touch screens cap the preview at 480 px or 55 svh (55 vh fallback); long diagrams scroll vertically. Actual size restores the viewBox width with block-local scrolling, while Fit resets the block scroll position. CSS sizing adapts to orientation changes without re-rendering Mermaid. Ordinary code blocks and tool output remain unchanged.
|
|
215
215
|
|
|
216
216
|
HTML text files (`.html` and `.htm`, case-insensitive) have preview/code modes. The preview iframe loads the signed file URL with `render=html`, streams the complete original document in its detected encoding, and carries a file-version query for live updates. Both the iframe and the response CSP use `sandbox allow-scripts` without `allow-same-origin`; the response sandbox also applies when the rendered URL is opened directly. Inline scripts/styles and embedded data/blob media are allowed, but external/local resource loading, network requests, forms, popups, and top-level navigation are not enabled. The outer viewer retains its own restrictive script policy, and raw/download responses are unchanged. Source remains escaped, syntax-highlighted where possible, limited to 2 MiB, and addressable with `#L<n>`.
|
|
217
217
|
|
|
@@ -244,6 +244,42 @@ Feishu local commands beginning with `!` are persisted under `command-jobs/` bes
|
|
|
244
244
|
|
|
245
245
|
At least one agent must be configured. `defaults.agent` must name a configured agent.
|
|
246
246
|
|
|
247
|
+
## Interactive browser terminal
|
|
248
|
+
|
|
249
|
+
The server stores the source contextKey and command-card message ID from the trusted Shell job, never from browser input. Topic authorization replies to that command card with reply_in_thread=true; private/group-body conversations use their original destination. Recovery retains this route even if the task moves. Delivery failure does not fall back to another destination. Management actions carry the original contextKey so their feedback remains in the same topic.
|
|
250
|
+
|
|
251
|
+
An approved terminal with no PTY exposes Open Terminal and accepts a fresh recovery authorization for the same ID. Only explicit owner approval rotates browser access; it refreshes the unstarted authorization window, not the absolute lifetime. No PTY starts during page load, recovery request or approval. Actual WebSocket authentication starts at most one Shell. Pending safe restart blocks both requesting and approving this first-start recovery, while already-running PTYs remain recoverable.
|
|
252
|
+
|
|
253
|
+
The authorization card updates in place into a terminal management card in the command’s original conversation/topic showing a stable terminal ID, cwd and connection state, with Close, Refresh and a separate `/terminal/<8-character-token>` link. The link is not an execution credential. A new tab generates a browser key and requests a five-minute recovery approval; only matching-code owner approval revokes the old browser and reuses the original PTY. Requesting, denying, expiring or cancelling pending recovery does not interrupt the original Shell. Recovery requests and approvals do not extend the three-minute disconnect deadline; only an authenticated WebSocket reattachment cancels it and restarts the thirty-minute idle timeout. The absolute lifetime never resets. Feishu closure validates owner, card ID and action token, independently of browser credentials. Recovery of a running Shell remains available during pending safe restart without consuming another PTY slot, with separate pending-recovery limits and request rate limiting. Close/exit updates the cards; late approvals never respawn ended terminals. Card-update failures are logged and can be retried with Refresh. Closing a browser tab allows three minutes to reconnect before its Shell is terminated.
|
|
254
|
+
|
|
255
|
+
The WebSocket ready frame carries a bounded output snapshot and replay flag. Initial attachment permits normal startup query responses; subsequent snapshots restore display only. xterm input/automatic responses remain disabled until asynchronous replay parsing completes, before queued live output is parsed in order. ANSI and user input are not regex-filtered. Each connection has a fresh xterm instance; stale callbacks cannot write to a new connection or release its replay guard.
|
|
256
|
+
|
|
257
|
+
Switching to a background tab preserves an existing WebSocket; pagehide/offline transitions disconnect it and pause recovery. Hidden tabs without a socket pause polling; visibilitychange, pageshow (including bfcache), online and focus resume the existing authorization. Status requests time out after ten seconds; network/transient server failures retry with 1/2/4/8/10-second capped backoff. WebSocket readiness has a fifteen-second timeout. Recovery is single-flight and ignores stale request/socket results. Automatic retries and manual Reconnect do not revoke approval, request another session or replay terminal input. Rejection, expiry, close and explicit Shell errors stop recovery. Logs record browser observation of approval, WebSocket authentication and failure stages, never codes, credentials or terminal input/output.
|
|
258
|
+
|
|
259
|
+
The `!` command card's Open Terminal link is a launch reference, not an execution credential. GET only loads local xterm.js assets. POST requests an owner-only Feishu authorization card in the original command conversation/topic with a six-digit verification code. Approval binds the owner, exact card, request token and random browser key, and expires in five minutes. Only an authenticated browser WebSocket starts the Shell. The browser key lives in sessionStorage and POST/WebSocket bodies, never URLs or cookies. Preview tokens cannot authorize terminals. Do not approve unsolicited requests or share launch links publicly.
|
|
260
|
+
|
|
261
|
+
```yaml
|
|
262
|
+
fileViewer:
|
|
263
|
+
enabled: true
|
|
264
|
+
host: "0.0.0.0"
|
|
265
|
+
port: 1423
|
|
266
|
+
# publicBaseUrl: "https://agentbot.example.com/bot"
|
|
267
|
+
terminal:
|
|
268
|
+
enabled: true
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
Terminals mount at `<Preview base path>/terminal` on the same HTTP server. Protocol, host, port, physical-network address selection and `publicBaseUrl` all come from `fileViewer`. Thus `http://10.0.0.2:1423/preview/...` pairs with `http://10.0.0.2:1423/terminal/xxxxxxxx`; a `/bot` proxy prefix is retained for pages, assets, API and WebSocket. No separate terminal listener, port file or networking configuration exists. Disable either Preview or `terminal.enabled` to hide terminal links. URLs only use `/terminal/<8-character-token>` for both new-shell and recovery links with case-sensitive base64url tokens. Open-link mappings live in `<data>/terminal/open-links/<SHA256(token)>.json`, contain only the token and command-job ID, and survive restart. Tokens are keyed pseudorandom references; collisions retry without overwriting an existing mapping, and hashed filenames preserve case sensitivity on Windows. GET and request handling resolve existing records only; they never create mappings. Recovery references are random and bound to one process-local session; they cannot restore a stopped Shell. Their tokens are durably reserved in the same mapping directory without session credentials, so neither current nor retired recovery tokens can collide with command tokens. Server-side resolution selects the mode for both page rendering and authorization requests; the page receives this as a data attribute, never infers it from the URL. The key in `<data>/terminal/secret` is used for stable command-token generation. Browser keys, approval tokens, owner checks and request throttling remain unchanged. Preview tokens never authorize terminal execution.
|
|
272
|
+
|
|
273
|
+
HTTP works on trusted LANs, but terminal credentials/input/output are unencrypted and vulnerable to network interception or modification; owner approval does not replace TLS. Use HTTPS for untrusted/Internet access. With a reverse proxy, preserve Host/Origin and support WebSocket upgrades on the same Preview address (`ws` for HTTP, `wss` for HTTPS). Avoid logging terminal URLs, credentials or traffic. No additional origin or domain is required.
|
|
274
|
+
|
|
275
|
+
Sharing the address does not share authorization. Terminal requests validate Host/Origin, including rejection of sandboxed `null` origins, JSON/frame limits and owner/card/browser credentials. File and Turn routes still only accept read-only requests. Rendered HTML keeps an opaque-origin response sandbox with inline scripts allowed but no same-origin privilege/network requests; raw files use a no-script sandbox as well, including HTML/SVG/XML opened directly. These prevent untrusted preview documents from reading terminal sessionStorage or interacting with its page. Only application-owned scripts should ever run in the shared origin.
|
|
276
|
+
|
|
277
|
+
`node-pty` is optional so native build failures do not prevent Agent Bot installation. If missing, terminal startup reports an error; reinstall optional dependencies with node-pty's documented compiler prerequisites. Windows requires Windows 10 1903/Server 2022 or newer (using the bundled ConPTY). PowerShell profiles are retained (`pwsh`, then Windows PowerShell, then `cmd.exe`). Unix uses `$SHELL`, login Shell or platform fallback in interactive mode. Input syntax highlighting comes from the Shell; xterm renders ANSI rather than parsing command languages.
|
|
278
|
+
|
|
279
|
+
Only cwd is inherited from the command card, never its command or process state. Shells have full host-user permissions. Filtering Feishu/Agent Bot internal environment variables is not sandboxing: host files and other inherited credentials remain accessible. Input/output is not logged by the application. Replay keeps only the latest 256 Ki characters in memory, not an unlimited transcript or guaranteed exact full-screen application state. Three pending/approved/running sessions are allowed; at least ten seconds between requests and twenty requests per hour. Authorization/connection expires after five minutes. Once a Shell starts, losing its browser connection starts a three-minute deadline, enforced by a dedicated timer and checked on requests. Successful WebSocket reattachment cancels the timer; output, polling, resize and recovery approval do not extend it. A connected foreground page prevents idle closure. Authenticated visibility frames renew foreground presence every thirty seconds, valid for ninety seconds; hidden pages stop heartbeats. Hiding the page or losing fresh foreground presence starts thirty minutes of input/output inactivity. Repeated hidden reports, polling, resize and approval do not reset inactivity. Successful authenticated reconnection cancels the disconnect deadline and restarts thirty idle minutes; input/output refreshes idle time but never the disconnect deadline. Either background-idle or disconnect timeout closes the Shell. Visibility messages never reach the PTY. Absolute lifetime remains eight hours.
|
|
280
|
+
|
|
281
|
+
Closing a tab disconnects; the Shell ends after three minutes without a successful reconnection. Close Terminal ends the Shell; detached processes may survive. Owner changes revoke sessions. Terminals do not survive Worker restart. Safe restart/update counts them separately from Agent tasks, displays them on its card and waits for closure. New Shells are blocked once restart is scheduled, while existing terminals may reconnect. ForceRestart/service stop closes terminals. Existing background `!` jobs and their Cancel action remain independent.
|
|
282
|
+
|
|
247
283
|
## Agent Runtimes
|
|
248
284
|
|
|
249
285
|
The configured Agent standard name is the runtime isolation key. Every configured Agent owns a separate, lazily started child process and runtime instance, even when multiple Agents use the same `kind`. Tasks using different Agents never share a command, environment, protocol connection, session map, or event stream. Tasks using the same Agent share that Agent process while keeping separate protocol sessions.
|
|
@@ -309,6 +345,10 @@ Incoming Feishu rich-text `code_block` elements are converted to fenced Markdown
|
|
|
309
345
|
|
|
310
346
|
Reasoning Preview receives `item/reasoning/summaryTextDelta`, `item/reasoning/textDelta`, and authoritative `item/completed` reasoning arrays. Optional `TurnViewState.reasoningItems` stores complete summary/content sections separately, anchored to existing activity IDs; legacy `reasoning:*:<summaryIndex>` activities remain a summary fallback. Only summary deltas continue through the existing card progress path. Content and completion updates persist without scheduling card refreshes. Preview extracts the first explicit leading Markdown heading or standalone bold title into the disclosure header, removes only that title from the expanded text, and renders all supplied summary/content sections without field labels. Linked/image headings retain their original body markup to preserve navigation and attachments; untitled text remains intact. Heading detection parses only a candidate first line, not the full Markdown. Preview details use `reasoning:<itemId>` keys and revision-aware lazy loading. No database schema migration or remote history backfill is performed.
|
|
311
347
|
|
|
348
|
+
Standalone rich-text/resource messages and merged forwards wait up to 1.5 seconds after acknowledgement/preparation for an associated attachment. Matching requires the same conversation and sender, an explicit parent-message ID, and a non-command attachment. An attachment reserves the pair on arrival, before awaiting its Reaction, so slow acknowledgement cannot split an already-matched pair. The combined request starts with the attached instruction, followed by the original reference text and resources; card Prompts and newly generated task titles use the instruction. Ordinary text, commands, and existing quoted messages do not enter this extra wait. Messages without an attachment proceed unchanged; later replies follow normal quote/steering behavior. The inbound representation has no separate forward flag: association uses message type, parent ID, and the short arrival window rather than guessing from message text.
|
|
349
|
+
|
|
350
|
+
Archiving (including Dismiss) reads task metadata and activity, not Turn history. On Codex's exact `thread/archive` error `no rollout found for thread id <id>`, empty-task cleanup is allowed only with a local binding and no recorded Turns, attempts (including failures), or inherited history. It rechecks remote metadata (empty preview, no fork parent, idle/notLoaded), local runtime activity, and that the reported rollout path is absent, then requires a successful `thread/unsubscribe` response before closing the local task. Other read/archive/release failures remain errors and leave the group intact; existing rollout files are never deleted or rewritten. If Feishu deletion fails after local archival, retrying the same confirmation retries group deletion only.
|
|
351
|
+
|
|
312
352
|
## Tasks, Projects, And External App Server Work
|
|
313
353
|
|
|
314
354
|
`/sessions` reads tasks through `thread/list` from every configured App Server Agent. For Codex, this includes tasks created by Codex Desktop, CLI, Agent Bot, or another App Server client under the same `CODEX_HOME`; other Agents expose their own task stores through the same protocol. Tasks are sorted globally before pagination: the current task first, then other active tasks, followed by idle tasks in descending last-activity order. The first ten global results determine page membership. Those visible tasks are then grouped by project in first-appearance order, with each project's tasks kept in descending activity order. Expanding a task directly shows the first 50 Unicode characters of its latest user Prompt without a field label, followed by its update time and action menu; runtime IDs, directory, loading state, and other status details remain in the dedicated Status view. `Previous` and `Next` replace the current card contents instead of appending more tasks, while preserving search terms and task numbers that match the displayed order.
|
|
@@ -321,6 +361,8 @@ Every `agentbot task` operation accepts `--task <task>` and retains the legacy l
|
|
|
321
361
|
|
|
322
362
|
Provider is stored on each task alongside model, reasoning effort, and permission mode. Each Agent can also keep these values under `agents.<name>.defaults`. New tasks start from the selected Agent's saved defaults, then override them with explicit or same-Agent inherited task settings. Agent Bot passes the resolved settings through `thread/start`, `thread/resume`, and `thread/fork` and persists the effective values returned by the runtime on the task.
|
|
323
363
|
|
|
364
|
+
Every `turn/start` also carries both `approvalPolicy` and `sandboxPolicy`: `auto` maps to `never` + `dangerFullAccess`, and `confirm` to `on-request` + `workspaceWrite`. Switching modes takes effect on the next Turn without restarting the shared App Server or resuming/forking the thread; `turn/steer` does not carry these overrides. Workspace policy options come from the thread lifecycle response; if unavailable, one cwd-scoped `config/read` resolves them lazily and the runtime caches them per session. This preserves configured writable roots, network access, and temporary-directory exclusions without reading history. Invalid/unavailable configuration blocks the new Turn; policy rejection is not retried without sandbox restrictions.
|
|
365
|
+
|
|
324
366
|
`/provider`, `/model`, `/thinking`, and `/permissions` open one Card 2.0 execution-settings surface with the matching tab active. All four commands reject arguments; tab navigation and setting changes use card callbacks only. Provider choices come from App Server `config/read`; for Codex, Agent Bot also keeps the implicit built-in `openai` Provider available when it is absent from the explicit `model_providers` map. The built-in OpenAI Provider uses App Server `model/list`. A configured custom Provider uses `GET <base_url>/models` when available, including its `query_params`, `http_headers`, `env_http_headers`, and configured Bearer credential; credentials remain internal and are never included in cards or model records. A Provider change keeps the previous model when it appears in the target catalog, otherwise selects the marked default, then the first returned model. Matching App Server catalog metadata supplies reasoning options when a custom endpoint returns only model IDs. If model discovery is unavailable, the current or configured model becomes a single fallback candidate so discovery does not block switching; Codex still verifies the effective Provider and model before Agent Bot persists the result. Every successful Provider, model, reasoning, or permission change updates the current task, atomically writes the complete effective setting group to that Agent's defaults in `config.yaml`, refreshes the same card in place, and applies from the next request. The equivalent CLI task-setting commands use the same persistence path.
|
|
325
367
|
|
|
326
368
|
Agent Bot keeps a local routing key for Feishu cards and delivery state, but presents the owning App Server's task ID to users. It does not resume, steer, stop, or fork externally running Agent work without an explicit user action.
|
|
@@ -335,6 +377,14 @@ Project behavior:
|
|
|
335
377
|
|
|
336
378
|
Forks use the latest available completed turn and do not interrupt an active source turn.
|
|
337
379
|
|
|
380
|
+
### History-preserving Provider switches
|
|
381
|
+
|
|
382
|
+
Settings switching uses only the existing thread ID: no implicit thread/start, thread/fork, history rewrite, synthetic Turn, or completed-Turn boundary. The controller independently rejects a changed thread ID before persistence. Settings-only hydration bypasses the old Provider resume, but requires a verified resume before execution. thread/unsubscribe is a subscription operation, not proof of unloading or external ownership: notSubscribed is idempotent, and a timeout requires recovery rather than an unverified success. Failed switches restore the same-thread Provider/model; missing or partial Agent defaults are restored by replacing the known YAML keys, not merging the rejected target back in. Disconnects during asynchronous persistence preserve the need to revalidate on the next request. No model prompt is sent merely to validate settings, so configuration success does not prove endpoint authentication/availability.
|
|
383
|
+
|
|
384
|
+
### Deferred Provider settings
|
|
385
|
+
|
|
386
|
+
`pending_provider_settings` stores a task-scoped target Provider/model/reasoning/permission bundle and the notification route independently of active session fields. Settings mutations and Turn starts are serialized per task, including multiple bound conversations. Cards use the pending Provider’s model catalog and mark the selection as pending; model/thinking callbacks carry the Provider ID to reject stale cards. Terminal events and startup recovery apply pending settings, and every Turn start checks them before submitting a Prompt. Failed switches restore the original Provider/model; a typed runtime error reports whether rollback succeeded. Only after verifying rollback and matching both runtime and persisted settings does the controller clear the draft, restore the card with a warning, and allow queued/new Prompts to continue. Failed or unverified rollback retains the draft and queued Prompts for explicit recovery. Archive clears the draft. Agent defaults are only persisted after the runtime confirms the actual Provider/model.
|
|
387
|
+
|
|
338
388
|
## Persistence And Recovery
|
|
339
389
|
|
|
340
390
|
SQLite stores:
|
|
@@ -347,11 +397,11 @@ SQLite stores:
|
|
|
347
397
|
- Progress snapshots and message bindings
|
|
348
398
|
- Final-message delivery records
|
|
349
399
|
|
|
350
|
-
On every Worker startup, Agent Bot scans nonterminal turn attempts before releasing persisted Prompt queues. Only attempts with activity during the preceding
|
|
400
|
+
On every Worker startup, Agent Bot scans nonterminal turn attempts before releasing persisted Prompt queues. Only attempts with activity during the preceding ten minutes are eligible; runtime events and a one-minute heartbeat refresh the durable activity timestamp while a turn remains active. Older unfinished attempts are marked interrupted without a recovery notification or continuation. Eligible recovery first notifies the original private chat, group, or topic. A remotely completed turn is synchronized and only its pending final delivery is resumed. A remotely active turn is reattached to a new progress card and polled until terminal. A stale App Server turn or an interrupted ACP process is continued in the same task and workspace with a new turn and a new progress card; the continuation Prompt tells the Agent to inspect existing effects before repeating work. Writer conflicts end automatic recovery and display the existing occupancy controls without closing any process. Other unconfirmed recovery failures retry every five seconds within a one-minute window, then close the recovery card and mark the attempt interrupted. Failed activity checks do not authorize replaying the Prompt. A confirmed live turn continues to be monitored through temporary connection outages; the retry window is not a turn execution timeout.
|
|
351
401
|
|
|
352
402
|
When a turn ends with a transient LLM-service failure, Agent Bot automatically starts up to three additional turns in the same task. Rate limits, temporary overload, upstream 5xx responses, timeouts, and interrupted provider streams are retryable. Authentication, quota exhaustion, context limits, invalid requests, unsupported models, permissions, policy failures, and tool errors are terminal immediately. Every retry gets a fresh progress card and a Prompt that warns the Agent to inspect existing effects before repeating work. The retry count and pending message bindings are persisted; original and steering-message reactions remain pending and follow the newest retry turn until it succeeds or exhausts the retry budget.
|
|
353
403
|
|
|
354
|
-
Agent Bot also reconciles when turn identifiers change, terminal notifications arrive, or control requests fail. Stale persisted `inProgress` turns are not considered active unless the App Server thread
|
|
404
|
+
Agent Bot also reconciles when turn identifiers change, terminal notifications arrive, or control requests fail. Stale persisted `inProgress` turns are not considered active unless the App Server reports active, or an unloaded thread has both an unfinished rollout and an OS-reported live writer. Process-inspection errors remain errors rather than being treated as idle. Writer checks are cached for five seconds independently of the incremental rollout cache; loaded idle/completed state takes precedence over old rollout starts.
|
|
355
405
|
|
|
356
406
|
The final-delivery ledger prevents duplicate successful replies. App Server requests use finite timeouts so a stalled request cannot permanently occupy a message route. Session lifecycle requests allow 60 seconds because compatible third-party Agents may need more than 30 seconds for `thread/start`; control requests remain shorter.
|
|
357
407
|
|
|
@@ -211,7 +211,7 @@ Turn Preview 复用 highlight.js,在服务端高亮显式标注语言的 Markd
|
|
|
211
211
|
|
|
212
212
|
输入附件路径分别保存在 `TurnViewState.promptImagePaths` 和用户活动的 `localImagePaths` 可选字段中,不混入受长度限制的文字。待启动轮次转为正式轮次、追加及重试、排队启动和快照恢复都会保留路径。Preview 通过现有签名文件服务加 `raw=1` 加载图片,文件缺失则显示占位提示。新增 JSON 字段不需要数据库迁移,也不会自动回填缺少路径的历史用户活动。
|
|
213
213
|
|
|
214
|
-
Turn Preview 支持在 Prompt、Commentary 和回答的 Markdown 中使用 `mermaid`、`flowchart`
|
|
214
|
+
Turn Preview 支持在 Prompt、Commentary 和回答的 Markdown 中使用 `mermaid`、`flowchart` 代码块。Markdown 文件预览复用相同的渲染器、切换控件、尺寸规则和安全策略,整份文件的代码视图及原始内容/下载保持不变。文件更新保留匹配图表的节点、模式、尺寸和滚动位置,仅重新渲染变化的源码。浏览器按需从同源 `/assets/mermaid.js` 加载锁定版本的 Mermaid(支持 `fileViewer.publicBaseUrl` 路径前缀),不依赖 CDN。严格模式禁用 HTML 标签和交互回调;拒绝 frontmatter、配置指令和超过 50,000 字符的源码,最多 500 条边。生成的 SVG 还会移除可执行元素和外部链接,保留现有 CSP。图表块默认预览并按宽度适配,SSE 更新保留手动模式、「适应 / 原大」选择和未变化的 SVG;加载或渲染失败时显示转义后的源码。SVG 宽度不超过 viewBox 原宽度和容器宽度,保持比例且不放大小图。窄屏或触摸设备的预览高度最多为 480 px 或 55 svh(回退为 55 vh),长图纵向滚动;原大恢复 viewBox 宽度并在块内滚动,切回适应时重置块内滚动位置。CSS 自动适应横竖屏切换,无需重新渲染 Mermaid。普通代码块和工具输出保持不变。
|
|
215
215
|
|
|
216
216
|
HTML 文本文件(`.html`、`.htm`,不区分大小写)支持预览与代码模式。预览 iframe 使用带 `render=html` 的签名文件 URL,按检测到的编码流式加载完整原文,并携带文件版本参数用于实时刷新。iframe 与响应 CSP 都使用 `sandbox allow-scripts`,不授予 `allow-same-origin`;直接打开渲染 URL 时,响应级沙箱仍生效。允许内联脚本、样式及 data/blob 嵌入媒体,不开放外部或本地资源加载、网络请求、表单、弹窗和顶层跳转。外层页面保持原有脚本限制,原始文件与下载响应不变。源码仍经过转义、按需高亮,限制为开头 2 MiB,并支持 `#L<n>` 行号定位。
|
|
217
217
|
|
|
@@ -244,6 +244,42 @@ HTML 文本文件(`.html`、`.htm`,不区分大小写)支持预览与代
|
|
|
244
244
|
|
|
245
245
|
必须至少配置一个 Agent,`defaults.agent` 必须指向已配置的 Agent。
|
|
246
246
|
|
|
247
|
+
## 交互式网页终端
|
|
248
|
+
|
|
249
|
+
路由从服务器保存的 Shell job 获取 contextKey 和命令卡片 ID,不接受浏览器指定。话题内授权通过 reply_in_thread=true 回复原命令卡;私聊与群正文沿用原目的地。重新授权保留该路由,不随任务后续移动而变化;投递失败不降级发往私聊或群正文。管理卡回调携带原 contextKey,反馈仍留在原话题。
|
|
250
|
+
|
|
251
|
+
已授权但尚无 PTY 的终端提供“打开终端”,新网页可为同一个终端 ID 申请重新授权。仅所有者明确批准后才切换浏览器访问权,并刷新首次启动的授权时限,不延长绝对寿命。页面加载、申请或批准都不启动 Shell,实际 WebSocket 鉴权后最多启动一个 Shell。安全重启等待期间阻止这类首次启动恢复的申请和批准,但已运行 PTY 仍可恢复。
|
|
252
|
+
|
|
253
|
+
授权卡在原命令会话中原位更新为终端管理卡,显示稳定终端 ID、目录和连接状态,可直接关闭或刷新,也可通过`/terminal/<8位token>` 短链接恢复。链接不是执行凭证:新标签页生成自己的浏览器密钥,申请五分钟有效的恢复授权;所有者核对验证码批准后,才撤销旧网页访问、连接原 PTY。请求、拒绝、过期或取消待批准恢复不会中断原 Shell;恢复申请或授权不延长三分钟断开时限,只有 WebSocket 鉴权并重新连接成功才取消断开计时并重置三十分钟空闲计时,绝对寿命不变。关闭操作校验所有者、卡片 ID 和操作令牌,不依赖浏览器凭证。已运行 Shell 的恢复不受新建终端的安全重启限制,也不额外占用 PTY 名额,但独立限制同时待批准恢复数和请求频率。关闭/退出更新管理卡,迟到批准不能重新创建已结束终端。卡片更新失败会记录警告,可用“刷新”重试;网页标签关闭后可在三分钟内重连,超时将结束 Shell。
|
|
254
|
+
|
|
255
|
+
WebSocket 就绪帧携带有界输出快照和回放标志:首次连接的启动输出允许正常查询响应,后续重连快照只恢复画面。回放期间禁用 xterm 输入/自动响应,等待异步解析完成后恢复,再按顺序解析实时输出;不会用正则删除 ANSI 或用户输入。每次连接使用独立的 xterm 实例,旧实例回调不能向新连接写入或解除其回放保护。
|
|
256
|
+
|
|
257
|
+
切换后台标签页保留现有 WebSocket;pagehide/离线时断开并暂停恢复,无连接的隐藏页面暂停轮询。visibilitychange、pageshow(含 bfcache)、online/focus 恢复时查询原授权。状态请求十秒超时,网络/暂时性服务错误按 1/2/4/8/10 秒上限退避重试;WebSocket 十五秒未就绪会重新连接。并发恢复事件只产生一个查询/连接,旧请求/旧 socket 的迟到结果会被忽略。自动重试和手动“重新连接”不撤销原授权,不重复申请或执行输入;拒绝、过期、关闭或 Shell 错误明确停止。日志只记录授权被浏览器观察、WebSocket 鉴权及失败阶段,不记录验证码、令牌或终端输入输出。
|
|
258
|
+
|
|
259
|
+
`!` 命令卡片的 Open Terminal 链接只用于申请连接,不是执行凭证。GET 只加载本地 xterm.js 资源;POST 才向原命令所在会话/话题发送六位验证码授权卡,仅所有者可批准。授权绑定所有者、原始卡片、请求令牌和随机浏览器密钥,五分钟有效;原浏览器通过 WebSocket 鉴权才启动 Shell。密钥仅在 sessionStorage 和 POST/WebSocket 请求体中,不放在 URL/Cookie。Preview token 无法授权终端。不要批准非本人发起的请求或公开分享入口链接。
|
|
260
|
+
|
|
261
|
+
```yaml
|
|
262
|
+
fileViewer:
|
|
263
|
+
enabled: true
|
|
264
|
+
host: "0.0.0.0"
|
|
265
|
+
port: 1423
|
|
266
|
+
# publicBaseUrl: "https://agentbot.example.com/bot"
|
|
267
|
+
terminal:
|
|
268
|
+
enabled: true
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
终端挂载到同一 HTTP 服务的 `<Preview 路径前缀>/terminal`。协议、主机、端口、物理网卡地址选择和 `publicBaseUrl` 全部来自 `fileViewer`。例如 `http://10.0.0.2:1423/preview/...` 对应 `http://10.0.0.2:1423/terminal/xxxxxxxx`;代理的 `/bot` 前缀会同时保留在页面、资源、API 和 WebSocket 路径中。不再单独监听端口、保存终端端口文件或提供终端网络配置。关闭 Preview 或 `terminal.enabled` 后不显示终端入口。链接仅支持 `/terminal/<8位token>`,新建和恢复共用这一格式,token 使用区分大小写的 base64url 字符。新建链接映射保存在 `<data>/terminal/open-links/<SHA256(token)>.json`,仅保存 token 和命令任务 ID,重启后仍有效。token 由密钥生成伪随机引用,冲突时重试且不覆盖已有映射;文件名哈希保证 Windows 下也能区分 token 大小写。GET 和请求授权只解析已有映射,不创建映射。恢复 token 随机生成,仅绑定当前进程的一个终端,不能恢复已关闭 Shell;同一映射目录永久保留 token 占位,不保存会话凭证,防止当前或过期的恢复 token 与命令 token 冲突。页面渲染和授权请求都由服务端解析 token 决定模式,通过 data 属性传给页面,不再从 URL 推断。`<data>/terminal/secret` 用于稳定生成新建 token;浏览器密钥、授权令牌、所有者检查和请求限频保持不变。Preview token 不能授权执行命令。
|
|
272
|
+
|
|
273
|
+
可信局域网支持 HTTP,但终端凭证/输入/输出没有加密,可被网络监听或篡改;所有者授权不能替代 TLS。不可信网络/互联网访问请使用 HTTPS。反向代理保留 Host/Origin,并在同一 Preview 地址支持 WebSocket 升级(HTTP 用 `ws`,HTTPS 用 `wss`),避免记录终端 URL、凭证或流量。不需要额外域名/origin。
|
|
274
|
+
|
|
275
|
+
共用地址不等于共用授权。终端仍校验 Host/Origin(拒绝沙箱的 `null` origin)、JSON/帧大小、所有者/原始卡片/浏览器凭证。文件和 Turn 路由仍只读。HTML 渲染保持响应级不透明 origin 沙箱,可执行内联脚本,但没有同源权限或网络访问;原始文件也使用禁止脚本的响应级沙箱,覆盖直接打开 HTML/SVG/XML,防止预览文档读取终端 sessionStorage 或操作终端页面。同源仅应运行应用自身脚本。
|
|
276
|
+
|
|
277
|
+
`node-pty` 为可选原生依赖,构建失败不阻塞 Agent Bot 安装,终端启动会提示错误;需按 node-pty 文档安装编译前置条件并重装可选依赖。Windows 需要 Windows 10 1903/Server 2022 或更新系统(使用 node-pty 随包提供的 ConPTY);保留 PowerShell profile,依次选择 `pwsh`、Windows PowerShell、`cmd.exe`。Unix 依次选择 `$SHELL`、登录 Shell、平台默认 Shell,以交互模式启动。输入高亮来自 Shell,xterm 渲染 ANSI,不解析命令语言。
|
|
278
|
+
|
|
279
|
+
只继承卡片 cwd,不继承原命令或进程状态;Shell 有主机用户完整权限。过滤飞书/Agent Bot 内部环境变量不等于沙箱,主机文件和其他继承凭证仍可访问。应用不记录终端输入/输出;内存仅保留最后 256 Ki 字符用于重连,不保存无限历史或保证完全重建所有全屏程序画面。最多三个待授权/已授权/运行中会话;每十秒最多一次申请,每小时二十次。授权/连接五分钟未完成会回收。Shell 启动后,网页断开即开始三分钟计时,由独立定时器执行,并在请求时校验;只有 WebSocket 鉴权后重连成功才取消计时,输出、轮询、resize 和恢复授权均不延长时限。连接正常且处于前台时不因空闲关闭。前台页面每三十秒通过已鉴权 WebSocket 上报可见性,有效九十秒,后台停止心跳;切到后台或前台状态失效后开始三十分钟无输入/输出计时。重复后台状态、轮询、resize、仅授权不重置空闲计时;成功重连取消断开计时并重置三十分钟空闲时间,输入/输出刷新空闲时间但不延长断开时限。后台空闲或断开超时任一满足即关闭,可见性消息不写入 PTY,累计八小时的绝对寿命不变。
|
|
280
|
+
|
|
281
|
+
关闭标签页后断开连接,三分钟内未成功重连则自动结束 Shell;“关闭终端”停止 Shell,脱离终端的后台进程可能继续运行。所有者变更撤销会话,Worker 重启不保留终端。安全重启/更新单独统计活动终端、在卡片提示并等待关闭;计划重启后禁止新建 Shell,已有终端可重连。ForceRestart/停止服务会关闭终端。原有后台 `!` 命令及 Cancel 行为不变。
|
|
282
|
+
|
|
247
283
|
## Agent Runtime
|
|
248
284
|
|
|
249
285
|
Agent 配置的标准名是运行时隔离键。每个配置的 Agent 都拥有独立、按需启动的子进程和 Runtime 实例,即使多个 Agent 使用相同的 `kind` 也不会合并。不同 Agent 的任务不会共享命令、环境变量、协议连接、会话映射或事件流;同一 Agent 的多个任务共享该 Agent 进程,但使用独立的协议会话。
|
|
@@ -309,6 +345,10 @@ Fork 从未绑定过 Agent Bot 的任务前,Agent Bot 会先读取不含 Turns
|
|
|
309
345
|
|
|
310
346
|
思考 Preview 接收 `item/reasoning/summaryTextDelta`、`item/reasoning/textDelta` 和 `item/completed` 中的完整 reasoning 数组。可选的 `TurnViewState.reasoningItems` 独立保存完整摘要/正文及活动位置锚点,旧版 `reasoning:*:<summaryIndex>` 活动作为摘要回退。只有摘要 delta 继续进入原有卡片进度路径,正文和完成更新仅持久化、不触发卡片刷新。Preview 将首个明确的开头 Markdown 标题或独立加粗标题移到折叠栏,展开区只移除该标题,并直接呈现全部已有摘要/正文,不添加字段标签。带链接或图片的标题保留原有正文标记,避免丢失跳转或附件;无标题原文完整保留。标题识别只解析候选首行,不渲染全文。Preview 详情使用 `reasoning:<itemId>` 键和版本校验按需加载。不迁移数据库结构,也不自动回填远端历史。
|
|
311
347
|
|
|
348
|
+
独立富文本、资源消息及合并转发在确认收到并完成前置准备后,最多等待 1.5 秒以合并关联附言。仅匹配同一会话、同一发送者、显式引用原消息 ID 的非命令消息;附言到达时先占位,再等待其 Reaction,避免慢确认拆散已匹配的消息。合并请求以附言作为主指令,随后保留原始参考文字及资源,卡片 Prompt 和新生成的任务标题使用附言。普通文本、命令及已有引用消息不增加此等待;没有附言则按原消息执行,窗口结束后的回复维持正常引用和追加行为。入站数据未单独保留转发标记,因此按消息类型、父消息 ID 和短时间窗口关联,不根据文字内容猜测是否为转发。
|
|
349
|
+
|
|
350
|
+
归档(包括 Dismiss)只读取任务元信息及活动状态,不查询 Turn 历史。Codex 的 `thread/archive` 精确返回 `no rollout found for thread id <id>` 时,仅对本地已绑定、没有任何 Turn、提交尝试(包括失败)和继承历史的任务允许空任务清理。再次确认远端预览为空、无 Fork 父任务、状态为 idle/notLoaded、本地运行时没有活动,且返回的 rollout 路径确实不存在后,必须成功执行 `thread/unsubscribe` 才会关闭本地任务。其他读取、归档或释放错误仍会阻止解散,不删除或改写已有历史文件。任务已归档但飞书解散失败时,重试同一确认卡片只重试解散群。
|
|
351
|
+
|
|
312
352
|
## 任务、项目与外部 App Server 工作
|
|
313
353
|
|
|
314
354
|
`/sessions` 通过 `thread/list` 读取每个已配置 App Server Agent 的任务。对于 Codex,可发现同一 `CODEX_HOME` 下由 Codex Desktop、CLI、Agent Bot 或其他 App Server 客户端创建的任务;其他 Agent 通过同一协议暴露各自的任务存储。任务会在分页前进行全局排序:当前任务最优先,其次是其他活跃任务,其余任务按最后活跃时间倒序排列。全局前 10 个任务只用于确定当前页成员;展示时再按项目首次出现顺序聚拢,每个项目内部继续按活跃时间倒序。展开任务后会直接显示最后一个用户 Prompt 的前 50 个 Unicode 字符,不再显示字段标签,之后是更新时间和操作菜单;运行时任务 ID、目录、加载状态等详情统一留在专门的 Status 视图中。`Previous` 和 `Next` 会替换当前卡片内容而不是继续追加任务,同时保留搜索条件以及与展示顺序一致的任务序号。
|
|
@@ -321,6 +361,8 @@ Fork 从未绑定过 Agent Bot 的任务前,Agent Bot 会先读取不含 Turns
|
|
|
321
361
|
|
|
322
362
|
Provider 会与模型、思考强度和权限模式一起保存在任务中;每个 Agent 还可以在 `agents.<name>.defaults` 下分别保存这些默认值。新任务先读取所选 Agent 的默认值,再由显式设置或同 Agent 任务继承值覆盖。Agent Bot 会通过 `thread/start`、`thread/resume` 和 `thread/fork` 传递最终设置,并把运行时返回的实际值保存到任务。
|
|
323
363
|
|
|
364
|
+
每次 `turn/start` 还会同时传递 `approvalPolicy` 和 `sandboxPolicy`:`auto` 对应 `never` + `dangerFullAccess`,`confirm` 对应 `on-request` + `workspaceWrite`。权限切换从下一轮生效,无需重启共享 App Server、恢复或分支任务;`turn/steer` 不携带这些覆盖参数。工作区策略优先取会话生命周期响应;缺失时按当前 cwd 懒加载一次 `config/read` 并按会话缓存,保留额外可写目录、网络访问和临时目录排除配置,不读取历史。配置无效或不可用时不启动新轮次;沙箱策略被拒绝时不会去掉限制后重试。
|
|
365
|
+
|
|
324
366
|
`/provider`、`/model`、`/thinking` 和 `/permissions` 打开同一张 Card 2.0 运行设置卡片,并激活对应的 tab。四个命令都拒绝参数,tab 切换和设置修改只通过卡片回调完成。Provider 选项来自 App Server 的 `config/read`;对于 Codex,即使隐式内置的 `openai` 没有出现在显式 `model_providers` 配置中,Agent Bot 也会保留该选项。内置 OpenAI Provider 使用 App Server 的 `model/list`;显式配置的自定义 Provider 会在接口可用时使用 `GET <base_url>/models`,并携带其 `query_params`、`http_headers`、`env_http_headers` 和已配置的 Bearer 凭据,凭据只在 Agent Bot 内部使用,不会进入卡片或模型记录。切换 Provider 时,如果目标模型目录包含原模型则继续使用;否则依次选择标记的默认模型和返回列表中的第一个模型。自定义接口只返回模型 ID 时,会按同名模型合并 App Server 目录中的思考强度元数据。模型发现不可用时,Agent Bot 会把当前或已配置模型作为唯一候选,因此不会因缺少 `/models` 而阻止切换;保存前仍由 Codex 返回的实际 Provider 和模型完成校验。每次成功修改 Provider、模型、思考强度或权限后,Agent Bot 都会更新当前任务,把完整生效设置原子写入该 Agent 在 `config.yaml` 中的默认值,就地刷新卡片,并从下一次请求生效;对应 CLI 任务设置命令使用相同的持久化路径。
|
|
325
367
|
|
|
326
368
|
Agent Bot 内部保留本地路由键以关联飞书卡片和投递状态,但对用户展示所属 App Server 的任务 ID。没有明确用户操作时,不会续写、steer、停止或分支其他客户端正在运行的 Agent 工作。
|
|
@@ -335,6 +377,14 @@ Agent Bot 内部保留本地路由键以关联飞书卡片和投递状态,但
|
|
|
335
377
|
|
|
336
378
|
分支使用最新可用的已完成 turn,不会中断来源任务的活动 turn。
|
|
337
379
|
|
|
380
|
+
### 保留历史的 Provider 切换
|
|
381
|
+
|
|
382
|
+
设置切换只使用现有线程 ID:不隐式调用 thread/start、thread/fork,不改写历史、不制造轮次,也不寻找已完成轮次边界。控制器在持久化前独立拒绝不同线程 ID。设置专用加载不依赖旧 Provider 的恢复成功,但执行前仍必须验证恢复结果。thread/unsubscribe 是订阅操作,不代表已卸载,也不能据此断言其他客户端占用;notSubscribed 按幂等结果处理,超时必须恢复验证而非报告成功。失败回退在同一线程验证原 Provider/模型,原本缺省或不完整的 Agent 默认值通过替换 YAML 已知字段恢复,不把失败目标重新合并进去。异步持久化期间断线会保留下一次请求前重新验证的标记。切设置不会偷偷发送模型 Prompt 测连,配置成功不等于端点认证或服务可用。
|
|
383
|
+
|
|
384
|
+
### Provider 延迟切换
|
|
385
|
+
|
|
386
|
+
`pending_provider_settings` 按任务保存目标 Provider、模型、思考强度、权限和通知路由,与实际 session 字段分离。设置修改和轮次启动按任务串行,覆盖多个会话绑定同一任务的情况。卡片使用目标 Provider 的模型列表并标注待生效,模型和思考强度回调携带 Provider ID,避免旧卡误操作。终态事件和启动恢复应用待生效设置,每次启动新轮次前也会检查。切换失败回退原 Provider/模型,运行时通过结构化错误报告回退结果。只有确认回退成功且运行时、持久化设置都与原设置一致时,才清除待生效选择、恢复卡片并显示警告,排队及新 Prompt 继续使用原设置。回退失败或无法确认时保留选择和排队 Prompt 等待手动恢复;归档清理待生效设置。仅在运行时确认实际 Provider/模型后才保存 Agent 默认值。
|
|
387
|
+
|
|
338
388
|
## 持久化与恢复
|
|
339
389
|
|
|
340
390
|
SQLite 保存:
|
|
@@ -347,7 +397,7 @@ SQLite 保存:
|
|
|
347
397
|
- 进度快照和消息绑定
|
|
348
398
|
- 最终消息投递记录
|
|
349
399
|
|
|
350
|
-
每次 Worker 启动时,Agent Bot 都会先扫描未终结的 turn 执行记录,再放行持久化的 Prompt 队列。只有前
|
|
400
|
+
每次 Worker 启动时,Agent Bot 都会先扫描未终结的 turn 执行记录,再放行持久化的 Prompt 队列。只有前 10 分钟内仍有活动的执行才具备恢复资格;turn 运行期间的运行时事件和每分钟心跳会刷新持久化的活动时间。更早的未完成执行会被标记为已中断,不发送恢复通知,也不创建续跑 turn。符合条件的恢复会先通知原私聊、群聊或话题;远端已完成的 turn 只同步状态并继续未完成的最终消息投递;远端仍活动的 turn 会换用新的进度卡并持续轮询到终态;已失效的 App Server turn 或被中断的 ACP 进程会在同一任务和工作目录中创建新的续跑 turn,续跑 Prompt 会要求 Agent 先检查已有副作用,避免重复操作。写锁冲突会终止自动恢复并显示占用卡片,不自动关闭任何进程。其他尚未确认恢复成功的故障每 5 秒重试,1 分钟重试窗口耗尽后关闭恢复卡片、标记中断并通知用户;活动检查失败不代表可以重放原 Prompt。已经确认活跃的轮次在临时断连期间继续监控,不受该恢复超时限制。未加载的 Codex 任务必须同时存在未结束的 rollout 和操作系统确认的存活写入进程,才补充为活跃状态;进程检查失败不会当成空闲。写入进程检查独立缓存 5 秒,不影响 rollout 增量读取;已加载任务的空闲或完成状态优先于旧日志中的开始事件。
|
|
351
401
|
|
|
352
402
|
当 turn 因临时 LLM 服务错误失败时,Agent Bot 会在同一任务中自动再创建最多 3 个 turn。限流、临时过载、上游 5xx、超时和模型服务流中断可以重试;认证失败、额度耗尽、上下文超限、无效请求、不支持的模型、权限或策略错误以及工具错误会立即终止。每次重试使用新的思考卡片,重试 Prompt 会要求 Agent 先检查已有副作用再继续,避免重复操作。重试次数和待处理消息绑定会持久化;原始消息及追加消息的 Reaction 会保持处理中,并跟随最新的重试 turn,直到成功或耗尽重试次数。
|
|
353
403
|
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keyou007/agent-bot",
|
|
3
|
-
"version": "0.1.24-alpha.
|
|
3
|
+
"version": "0.1.24-alpha.6",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@keyou007/agent-bot",
|
|
9
|
-
"version": "0.1.24-alpha.
|
|
9
|
+
"version": "0.1.24-alpha.6",
|
|
10
10
|
"license": "GPL-3.0-only",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@agentclientprotocol/sdk": "1.2.1",
|
|
13
13
|
"@clack/prompts": "1.7.0",
|
|
14
14
|
"@larksuiteoapi/node-sdk": "1.73.0",
|
|
15
15
|
"@resvg/resvg-js": "2.6.2",
|
|
16
|
+
"@xterm/addon-fit": "0.11.0",
|
|
17
|
+
"@xterm/xterm": "6.0.0",
|
|
16
18
|
"better-sqlite3": "12.11.1",
|
|
17
19
|
"dotenv": "17.4.2",
|
|
18
20
|
"highlight.js": "11.12.0",
|
|
19
21
|
"markdown-it": "15.0.1",
|
|
20
22
|
"mermaid": "11.17.2",
|
|
21
23
|
"pino": "10.3.1",
|
|
24
|
+
"ws": "8.21.3",
|
|
22
25
|
"yaml": "2.9.0",
|
|
23
26
|
"zod": "4.4.3"
|
|
24
27
|
},
|
|
@@ -29,6 +32,7 @@
|
|
|
29
32
|
"devDependencies": {
|
|
30
33
|
"@types/better-sqlite3": "7.6.13",
|
|
31
34
|
"@types/node": "22.18.11",
|
|
35
|
+
"@types/ws": "8.18.1",
|
|
32
36
|
"eslint": "10.6.0",
|
|
33
37
|
"linkedom": "0.18.13",
|
|
34
38
|
"prettier": "3.9.5",
|
|
@@ -38,6 +42,9 @@
|
|
|
38
42
|
},
|
|
39
43
|
"engines": {
|
|
40
44
|
"node": ">=22"
|
|
45
|
+
},
|
|
46
|
+
"optionalDependencies": {
|
|
47
|
+
"node-pty": "1.1.0"
|
|
41
48
|
}
|
|
42
49
|
},
|
|
43
50
|
"node_modules/@agentclientprotocol/sdk": {
|
|
@@ -1742,6 +1749,16 @@
|
|
|
1742
1749
|
"license": "MIT",
|
|
1743
1750
|
"optional": true
|
|
1744
1751
|
},
|
|
1752
|
+
"node_modules/@types/ws": {
|
|
1753
|
+
"version": "8.18.1",
|
|
1754
|
+
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz",
|
|
1755
|
+
"integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==",
|
|
1756
|
+
"dev": true,
|
|
1757
|
+
"license": "MIT",
|
|
1758
|
+
"dependencies": {
|
|
1759
|
+
"@types/node": "*"
|
|
1760
|
+
}
|
|
1761
|
+
},
|
|
1745
1762
|
"node_modules/@typescript/typescript-aix-ppc64": {
|
|
1746
1763
|
"version": "7.0.2",
|
|
1747
1764
|
"resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz",
|
|
@@ -2205,6 +2222,21 @@
|
|
|
2205
2222
|
"url": "https://opencollective.com/vitest"
|
|
2206
2223
|
}
|
|
2207
2224
|
},
|
|
2225
|
+
"node_modules/@xterm/addon-fit": {
|
|
2226
|
+
"version": "0.11.0",
|
|
2227
|
+
"resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.11.0.tgz",
|
|
2228
|
+
"integrity": "sha512-jYcgT6xtVYhnhgxh3QgYDnnNMYTcf8ElbxxFzX0IZo+vabQqSPAjC3c1wJrKB5E19VwQei89QCiZZP86DCPF7g==",
|
|
2229
|
+
"license": "MIT"
|
|
2230
|
+
},
|
|
2231
|
+
"node_modules/@xterm/xterm": {
|
|
2232
|
+
"version": "6.0.0",
|
|
2233
|
+
"resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-6.0.0.tgz",
|
|
2234
|
+
"integrity": "sha512-TQwDdQGtwwDt+2cgKDLn0IRaSxYu1tSUjgKarSDkUM0ZNiSRXFpjxEsvc/Zgc5kq5omJ+V0a8/kIM2WD3sMOYg==",
|
|
2235
|
+
"license": "MIT",
|
|
2236
|
+
"workspaces": [
|
|
2237
|
+
"addons/*"
|
|
2238
|
+
]
|
|
2239
|
+
},
|
|
2208
2240
|
"node_modules/acorn": {
|
|
2209
2241
|
"version": "8.17.0",
|
|
2210
2242
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz",
|
|
@@ -4781,6 +4813,24 @@
|
|
|
4781
4813
|
"node": ">=10"
|
|
4782
4814
|
}
|
|
4783
4815
|
},
|
|
4816
|
+
"node_modules/node-addon-api": {
|
|
4817
|
+
"version": "7.1.1",
|
|
4818
|
+
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz",
|
|
4819
|
+
"integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==",
|
|
4820
|
+
"license": "MIT",
|
|
4821
|
+
"optional": true
|
|
4822
|
+
},
|
|
4823
|
+
"node_modules/node-pty": {
|
|
4824
|
+
"version": "1.1.0",
|
|
4825
|
+
"resolved": "https://registry.npmjs.org/node-pty/-/node-pty-1.1.0.tgz",
|
|
4826
|
+
"integrity": "sha512-20JqtutY6JPXTUnL0ij1uad7Qe1baT46lyolh2sSENDd4sTzKZ4nmAFkeAARDKwmlLjPx6XKRlwRUxwjOy+lUg==",
|
|
4827
|
+
"hasInstallScript": true,
|
|
4828
|
+
"license": "MIT",
|
|
4829
|
+
"optional": true,
|
|
4830
|
+
"dependencies": {
|
|
4831
|
+
"node-addon-api": "^7.1.0"
|
|
4832
|
+
}
|
|
4833
|
+
},
|
|
4784
4834
|
"node_modules/nth-check": {
|
|
4785
4835
|
"version": "3.0.1",
|
|
4786
4836
|
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-3.0.1.tgz",
|
|
@@ -6004,9 +6054,9 @@
|
|
|
6004
6054
|
"license": "ISC"
|
|
6005
6055
|
},
|
|
6006
6056
|
"node_modules/ws": {
|
|
6007
|
-
"version": "8.21.
|
|
6008
|
-
"resolved": "https://registry.npmjs.org/ws/-/ws-8.21.
|
|
6009
|
-
"integrity": "sha512-
|
|
6057
|
+
"version": "8.21.3",
|
|
6058
|
+
"resolved": "https://registry.npmjs.org/ws/-/ws-8.21.3.tgz",
|
|
6059
|
+
"integrity": "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw==",
|
|
6010
6060
|
"license": "MIT",
|
|
6011
6061
|
"engines": {
|
|
6012
6062
|
"node": ">=10.0.0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keyou007/agent-bot",
|
|
3
|
-
"version": "0.1.24-alpha.
|
|
3
|
+
"version": "0.1.24-alpha.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Use Codex, TraeX, and compatible coding agents from Lark/Feishu.",
|
|
6
6
|
"license": "GPL-3.0-only",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"start:once": "node dist/index.js",
|
|
54
54
|
"cli": "node dist/cli.js",
|
|
55
55
|
"test": "npm run test:unit && npm run test:process && npm run test:render",
|
|
56
|
-
"test:unit": "vitest run --exclude tests/shell/ShellCommandJobManager.test.ts --exclude tests/scripts/prepare-release.test.ts --exclude tests/feishu/GroupAvatarGenerator.test.ts",
|
|
57
|
-
"test:process": "vitest run tests/shell/ShellCommandJobManager.test.ts tests/scripts/prepare-release.test.ts --maxWorkers=1",
|
|
56
|
+
"test:unit": "vitest run --exclude tests/shell/ShellCommandJobManager.test.ts --exclude tests/scripts/prepare-release.test.ts --exclude tests/feishu/GroupAvatarGenerator.test.ts --exclude tests/terminal/TerminalPty.process.test.ts",
|
|
57
|
+
"test:process": "vitest run tests/shell/ShellCommandJobManager.test.ts tests/scripts/prepare-release.test.ts tests/terminal/TerminalPty.process.test.ts --maxWorkers=1",
|
|
58
58
|
"test:render": "vitest run tests/feishu/GroupAvatarGenerator.test.ts --maxWorkers=1",
|
|
59
59
|
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json",
|
|
60
60
|
"verify": "npm run typecheck && npm test",
|
|
@@ -71,18 +71,22 @@
|
|
|
71
71
|
"@clack/prompts": "1.7.0",
|
|
72
72
|
"@larksuiteoapi/node-sdk": "1.73.0",
|
|
73
73
|
"@resvg/resvg-js": "2.6.2",
|
|
74
|
+
"@xterm/addon-fit": "0.11.0",
|
|
75
|
+
"@xterm/xterm": "6.0.0",
|
|
74
76
|
"better-sqlite3": "12.11.1",
|
|
75
77
|
"dotenv": "17.4.2",
|
|
76
78
|
"highlight.js": "11.12.0",
|
|
77
79
|
"markdown-it": "15.0.1",
|
|
78
80
|
"mermaid": "11.17.2",
|
|
79
81
|
"pino": "10.3.1",
|
|
82
|
+
"ws": "8.21.3",
|
|
80
83
|
"yaml": "2.9.0",
|
|
81
84
|
"zod": "4.4.3"
|
|
82
85
|
},
|
|
83
86
|
"devDependencies": {
|
|
84
87
|
"@types/better-sqlite3": "7.6.13",
|
|
85
88
|
"@types/node": "22.18.11",
|
|
89
|
+
"@types/ws": "8.18.1",
|
|
86
90
|
"eslint": "10.6.0",
|
|
87
91
|
"linkedom": "0.18.13",
|
|
88
92
|
"prettier": "3.9.5",
|
|
@@ -96,5 +100,8 @@
|
|
|
96
100
|
"engines": {
|
|
97
101
|
"node": ">=22"
|
|
98
102
|
},
|
|
99
|
-
"packageManager": "npm@11.12.1"
|
|
103
|
+
"packageManager": "npm@11.12.1",
|
|
104
|
+
"optionalDependencies": {
|
|
105
|
+
"node-pty": "1.1.0"
|
|
106
|
+
}
|
|
100
107
|
}
|
|
@@ -77,6 +77,7 @@ agentbot task title "<title>"
|
|
|
77
77
|
- `stop` requests an Agent interrupt; it does not kill the Agent process.
|
|
78
78
|
- `release` sends a Lark confirmation card for releasing the Agent's shared App Server. It never releases automatically; the user must click **Release** or **Release Now** on the card.
|
|
79
79
|
- `dismiss --yes` irreversibly dissolves the task's current Feishu group and archives its current task. Use it only after the user explicitly confirms.
|
|
80
|
+
- Newly created tasks can be archived or dismissed before their first Prompt. Do not send a dummy Prompt to create history; Agent Bot safely releases a confirmed empty task when Codex has no rollout to archive.
|
|
80
81
|
|
|
81
82
|
From Feishu, `/release` sends a confirmation card for handing App Server tasks back to Codex Desktop without archiving them. It lists the current Agent's running and queued work and never releases automatically. **Release** confirms an idle release, **Release Now** interrupts active work and clears queued Prompts, and **Cancel** cancels the pending release. Because each App Server Agent is shared, releasing affects every task loaded by that Agent process.
|
|
82
83
|
|
|
@@ -114,7 +115,7 @@ Feishu group renames update only the group's currently bound task title, not top
|
|
|
114
115
|
|
|
115
116
|
Fork creation stores source-task and branch-Turn references without synchronizing the full local Turn list. The Feishu Turn card reuses local records and loads only the summary pages needed for the requested page, not the entire history. `task turns` loads the first page if necessary and returns available local records. This does not change the Agent's inherited context. Retry listing Turns after a temporary history-read failure; unsupported summary pagination never falls back to downloading full history.
|
|
116
117
|
|
|
117
|
-
|
|
118
|
+
TraeX plan-mode confirmations follow the task permission mode. With `auto`, Agent Bot automatically accepts Enter Plan Mode and Approve Plan; do not also approve or send a continuation prompt. With `confirm`, `Approve Plan` / `Enter Plan Mode`, `Reject`, and `Cancel Request` require the user's choice. Approval requests and decisions stay in the same thinking card and live Preview, explicitly labeling automatic approvals. If an automatic response fails, the card offers manual confirmation with an error notice; never pretend it succeeded. Approved implementation continues in the same task and card. Explicit discussion-only or no-implementation instructions still apply. Preview cannot approve, cancelling a request does not itself stop the task, and waiting turns still block safe restart. Do not stop or force-restart merely to clear that wait. Missed notifications from older versions are not automatically replayed.
|
|
118
119
|
|
|
119
120
|
## Change Settings
|
|
120
121
|
|
|
@@ -130,11 +131,15 @@ agentbot task permissions [auto|confirm]
|
|
|
130
131
|
|
|
131
132
|
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 and become the saved defaults for that Agent.
|
|
132
133
|
|
|
134
|
+
For App Server tasks, `permissions auto` applies `never` approval and `dangerFullAccess` sandbox policies on the next Turn; `permissions confirm` applies `on-request` and `workspaceWrite`, preserving configured workspace restrictions. No Agent restart, fork, or new task is needed. Steering or changing the setting does not re-sandbox tools already executing. Feishu `/permissions` takes no arguments: choose the mode on its card.
|
|
135
|
+
|
|
133
136
|
A successful Provider switch confirms settings, not inference connectivity. Model-list fallback warnings appear on settings cards; inspect the Provider service when availability is unconfirmed. App Server errors and native retry notices show the message and supplied `additionalDetails` as literal text on the current progress card and Preview without terminating the turn. Use Preview for long reasons; `Reconnecting` alone does not identify the cause when the Agent supplies no details, and old snapshots are not backfilled. Do not stop or restart a retrying task unless the user requests it.
|
|
134
137
|
|
|
135
138
|
Providers such as a Responses bridge may omit assistant message phases. Unphased text stays in the progress timeline; successful completion promotes only the last message not followed by a tool start. Do not diagnose progress text in the answer area as a CSS issue without checking message phases. Old snapshots are not automatically backfilled.
|
|
136
139
|
|
|
137
|
-
Provider changes
|
|
140
|
+
Provider changes during an Agent Bot turn are staged until it ends; do not stop the turn. The settings card and CLI show the pending Provider/model, and model/thinking/permission selections edit that pending configuration. The latest selection is applied before the next turn, including queued/retried turns. Pending settings survive restart, remain separate from actual task settings, and are verified before saving Agent defaults. Deferred failures roll back to the original Provider/model. After the runtime confirms rollback, the card returns to the original settings, the pending selection is cleared, and queued prompts continue with the original settings. Failed or unverified rollback still pauses queued prompts and requires explicit recovery; never claim rollback success based only on unchanged local fields. Custom Providers discover models through their OpenAI-compatible `/models` endpoint when available. Switching keeps the previous model when supported, otherwise uses the Provider default or its first model. A missing model-list endpoint falls back to the current or configured model and does not by itself block switching. Wait for active work to finish; do not stop it without the user's request. Switching unloads only the selected thread, not the shared App Server. On failure, previous settings are retained and recovery is attempted. If recovery fails, resolve the reported configuration or ownership issue and retry the Provider switch before sending another prompt. Never replace a forked task with an empty task to work around a switch failure.
|
|
141
|
+
|
|
142
|
+
Provider changes must keep the same remote task ID and complete history. Never use Fork, thread replacement, synthetic Turns, or history repair to change settings. A rejected switch must report the reason and verify rollback; if App Server retains a stale Provider, suggest an explicit safe restart and retry rather than restarting the shared process implicitly. Settings inspection and selection must remain available when the old Provider cannot resume.
|
|
138
143
|
|
|
139
144
|
## Goals And Turns
|
|
140
145
|
|
|
@@ -153,6 +158,8 @@ The Feishu `/sessions` card also has `SwitchGroup`: create a new group bound to
|
|
|
153
158
|
|
|
154
159
|
The Feishu `/sessions` card provides `Turns` for each task, including unbound external tasks. Browsing and pagination never switch, resume, or bind a task; Reset is available only for the current task.
|
|
155
160
|
|
|
161
|
+
Expand a running task in `/sessions` to use its `Stop` button, including the current task and tasks in other conversations or external clients. It requests the normal Agent interrupt without switching tasks or killing processes; only click it when the user requests stopping that task. The refreshed list preserves search/page and uses actual Agent status, not interrupt acknowledgement, to decide whether Stop remains available. Archive is offered only when idle.
|
|
162
|
+
|
|
156
163
|
Use `turns` to obtain a real Turn ID before `reset`. Reset changes conversation context only; it does not revert local files. Agent Bot announces an interactive Reset when it starts and queues every new message after its Reaction until the replacement thread is ready.
|
|
157
164
|
|
|
158
165
|
## Files And Local Commands
|
|
@@ -171,8 +178,12 @@ For group mention-only mode (ordinary @ Prompts also receive bounded recent text
|
|
|
171
178
|
agentbot task mute on|off
|
|
172
179
|
```
|
|
173
180
|
|
|
181
|
+
Feishu `!` command cards offer **Open Terminal** for an independent browser Shell in the card's cwd. The owner requests it in the browser and approves the matching code in the original command conversation/topic; never approve it on the user's behalf or replay the original command. Execution uses full host-user permissions, not an Agent sandbox. Terminal links share the Preview protocol, host, port and base path (`fileViewer` settings), using `/terminal/<8-character-token>` for both command and recovery links; the server selects behavior from the token; there is no separate terminal address. Case-sensitive short tokens only locate commands or sessions, never authorize execution. Open links persist across restart; resume links cannot restore a Shell from a previous process. Only `/terminal/<8-character-token>` links are supported. HTTP works only as a trusted-network deployment choice; use HTTPS on untrusted networks. Owner authorization stays independent, and Preview documents must remain sandboxed. Disabling Preview also disables terminals. Closing a page starts a three-minute disconnect timeout; successful reconnection cancels it, but output and recovery approval do not extend it. Successful authenticated reconnection also restarts thirty idle minutes. A connected foreground page with fresh visibility heartbeats prevents idle closure; hiding the page starts the thirty-minute input/output idle timeout. Either background-idle or disconnect timeout closes the Shell. Close Terminal ends the Shell immediately. Active terminals block safe restart, new ones are blocked while restart is scheduled, and sessions do not survive service restart.
|
|
182
|
+
|
|
174
183
|
## Manage The Service
|
|
175
184
|
|
|
185
|
+
If a terminal tab is lost, direct the user to its terminal management card in the original Feishu conversation/topic: Open Terminal is available before the first connection; Reopen restores the same running Shell after fresh code approval, and Close Terminal works without the webpage. Refresh retries card state updates. Old browser access is revoked only after approved recovery. Recovery of an already-running Shell and closure remain usable while safe restart waits; starting an unconnected Shell remains blocked; do not force restart or approve recovery on the user's behalf. The original command card's Open Terminal creates a new Shell, not a recovery.
|
|
186
|
+
|
|
176
187
|
```powershell
|
|
177
188
|
agentbot server start
|
|
178
189
|
agentbot server status
|
|
@@ -216,6 +227,8 @@ Use `init --reset` only for an explicitly requested full reset. Without `--profi
|
|
|
216
227
|
|
|
217
228
|
## After Code Changes
|
|
218
229
|
|
|
230
|
+
For tasks stuck after a Worker crash, inspect the recovery notice and any writer-conflict card before acting. Unconfirmed recovery retries stop after a one-minute window; a live writer conflict stops them immediately. An old unfinished rollout or a leftover lock file alone is not proof of a running task. Do not delete locks, edit task state, or close another Agent process automatically. Already-confirmed live turns remain monitored; ask the user before stopping them.
|
|
231
|
+
|
|
219
232
|
Run the relevant checks, then build:
|
|
220
233
|
|
|
221
234
|
```powershell
|