
























@@ -513,74 +513,11 @@ curl "https://api.telegram.org/bot<bot_token>/getUpdates"
513513514514Each topic then has its own session key: `agent:zu:telegram:group:-1001234567890:topic:3`
515515516-**Persistent ACP topic binding**: Forum topics can pin ACP harness sessions through top-level typed ACP bindings:
516+**Persistent ACP topic binding**: Forum topics can pin ACP harness sessions through top-level typed ACP bindings (`bindings[]` with `type: "acp"` and `match.channel: "telegram"`, `peer.kind: "group"`, and a topic-qualified id like `-1001234567890:topic:42`). Currently scoped to forum topics in groups/supergroups. See [ACP Agents](/tools/acp-agents).
517517518-- `bindings[]` with `type: "acp"` and `match.channel: "telegram"`
518+**Thread-bound ACP spawn from chat**: `/acp spawn <agent> --thread here|auto` binds the current topic to a new ACP session; follow-ups route there directly. OpenClaw pins the spawn confirmation in-topic. Requires `channels.telegram.threadBindings.spawnAcpSessions=true`.
519519520-Example:
521-522-```json5
523-{
524- agents: {
525- list: [
526- {
527- id: "codex",
528- runtime: {
529- type: "acp",
530- acp: {
531- agent: "codex",
532- backend: "acpx",
533- mode: "persistent",
534- cwd: "/workspace/openclaw",
535- },
536- },
537- },
538- ],
539- },
540- bindings: [
541- {
542- type: "acp",
543- agentId: "codex",
544- match: {
545- channel: "telegram",
546- accountId: "default",
547- peer: { kind: "group", id: "-1001234567890:topic:42" },
548- },
549- },
550- ],
551- channels: {
552- telegram: {
553- groups: {
554- "-1001234567890": {
555- topics: {
556- "42": {
557- requireMention: false,
558- },
559- },
560- },
561- },
562- },
563- },
564-}
565-```
566-567-This is currently scoped to forum topics in groups and supergroups.
568-569-**Thread-bound ACP spawn from chat**:
570-571-- `/acp spawn <agent> --thread here|auto` can bind the current Telegram topic to a new ACP session.
572-- Follow-up topic messages route to the bound ACP session directly (no `/acp steer` required).
573-- OpenClaw pins the spawn confirmation message in-topic after a successful bind.
574-- Requires `channels.telegram.threadBindings.spawnAcpSessions=true`.
575-576-Template context includes:
577-578-- `MessageThreadId`
579-- `IsForum`
580-581-DM thread behavior:
582-583-- private chats with `message_thread_id` keep DM routing but use thread-aware session keys/reply targets.
520+Template context exposes `MessageThreadId` and `IsForum`. DM chats with `message_thread_id` keep DM routing but use thread-aware session keys.
584521585522</Accordion>
586523@@ -745,27 +682,10 @@ curl "https://api.telegram.org/bot<bot_token>/getUpdates"
745682746683</Accordion>
747684748-<Accordion title="Model picker authorization in groups">
749-Group model-picker inline buttons require the same authorization as `/models`. Unauthorized participants can browse and tap buttons, but OpenClaw rejects the callback before changing the session model.
750-</Accordion>
751-752685<Accordion title="Long polling vs webhook">
753-Default: long polling.
754-755-Webhook mode:
756-757-- set `channels.telegram.webhookUrl`
758-- set `channels.telegram.webhookSecret` (required when webhook URL is set)
759-- optional `channels.telegram.webhookPath` (default `/telegram-webhook`)
760-- optional `channels.telegram.webhookHost` (default `127.0.0.1`)
761-- optional `channels.telegram.webhookPort` (default `8787`)
686+Default is long polling. For webhook mode set `channels.telegram.webhookUrl` and `channels.telegram.webhookSecret`; optional `webhookPath`, `webhookHost`, `webhookPort` (defaults `/telegram-webhook`, `127.0.0.1`, `8787`).
762687763-Default local listener for webhook mode binds to `127.0.0.1:8787`.
764-765-If your public endpoint differs, place a reverse proxy in front and point `webhookUrl` at the public URL.
766-Set `webhookHost` (for example `0.0.0.0`) when you intentionally need external ingress.
767-768-The grammY webhook callback returns a 200 within 5 seconds so Telegram does not retry long-running updates as read timeouts; longer work continues in the background. Polling rebuilds the HTTP transport after `getUpdates` 409 conflicts, so retries use a fresh TCP connection instead of looping on a Telegram-terminated keep-alive socket.
688+The local listener binds to `127.0.0.1:8787`. For public ingress, either put a reverse proxy in front of the local port or set `webhookHost: "0.0.0.0"` intentionally.
769689770690</Accordion>
771691@@ -821,45 +741,20 @@ openclaw message poll --channel telegram --target -1001234567890:topic:42 \
821741</Accordion>
822742823743<Accordion title="Exec approvals in Telegram">
824-Telegram supports exec approvals in approver DMs and can optionally post approval prompts in the originating chat or topic.
744+Telegram supports exec approvals in approver DMs and can optionally post prompts in the originating chat or topic. Approvers must be numeric Telegram user IDs.
825745826746Config path:
827747828-- `channels.telegram.execApprovals.enabled`
829-- `channels.telegram.execApprovals.approvers` (optional; falls back to numeric owner IDs inferred from `allowFrom` and direct `defaultTo` when possible)
830-- `channels.telegram.execApprovals.target` (`dm` | `channel` | `both`, default: `dm`)
748+- `channels.telegram.execApprovals.enabled` (auto-enables when at least one approver is resolvable)
749+- `channels.telegram.execApprovals.approvers` (falls back to numeric owner IDs from `allowFrom` / `defaultTo`)
750+- `channels.telegram.execApprovals.target`: `dm` (default) | `channel` | `both`
831751- `agentFilter`, `sessionFilter`
832752833-Approvers must be numeric Telegram user IDs. Telegram auto-enables native exec approvals when `enabled` is unset or `"auto"` and at least one approver can be resolved, either from `execApprovals.approvers` or from the account's numeric owner config (`allowFrom` and direct-message `defaultTo`). Set `enabled: false` to disable Telegram as a native approval client explicitly. Approval requests otherwise fall back to other configured approval routes or the exec approval fallback policy.
834-835-Telegram also renders the shared approval buttons used by other chat channels. The native Telegram adapter mainly adds approver DM routing, channel/topic fanout, and typing hints before delivery.
836-When those buttons are present, they are the primary approval UX; OpenClaw
837-should only include a manual `/approve` command when the tool result says
838-chat approvals are unavailable or manual approval is the only path.
839-840-Delivery rules:
841-842-- `target: "dm"` sends approval prompts only to resolved approver DMs
843-- `target: "channel"` sends the prompt back to the originating Telegram chat/topic
844-- `target: "both"` sends to approver DMs and the originating chat/topic
845-846-Only resolved approvers can approve or deny. Non-approvers cannot use `/approve` and cannot use Telegram approval buttons.
847-848-Approval resolution behavior:
849-850-- IDs prefixed with `plugin:` always resolve through plugin approvals.
851-- Other approval IDs try `exec.approval.resolve` first.
852-- If Telegram is also authorized for plugin approvals and the gateway says
853- the exec approval is unknown/expired, Telegram retries once through
854- `plugin.approval.resolve`.
855-- Real exec approval denials/errors do not silently fall through to plugin
856- approval resolution.
857-858-Channel delivery shows the command text in the chat, so only enable `channel` or `both` in trusted groups/topics. When the prompt lands in a forum topic, OpenClaw preserves the topic for both the approval prompt and the post-approval follow-up. Exec approvals expire after 30 minutes by default.
753+Channel delivery shows the command text in the chat; only enable `channel` or `both` in trusted groups/topics. When the prompt lands in a forum topic, OpenClaw preserves the topic for the approval prompt and the follow-up. Exec approvals expire after 30 minutes by default.
859754860-Inline approval buttons also depend on `channels.telegram.capabilities.inlineButtons` allowing the target surface (`dm`, `group`, or `all`).
755+Inline approval buttons also require `channels.telegram.capabilities.inlineButtons` to allow the target surface (`dm`, `group`, or `all`). Approval IDs prefixed with `plugin:` resolve through plugin approvals; others resolve through exec approvals first.
861756862-Related docs: [Exec approvals](/tools/exec-approvals)
757+See [Exec approvals](/tools/exec-approvals).
863758864759</Accordion>
865760</AccordionGroup>
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。