fix(delivery-queue): enhance Telegram 'bot was kicked' error with helpful hints#29085
fix(delivery-queue): enhance Telegram 'bot was kicked' error with helpful hints#29085kevinWangSheng wants to merge 3 commits into
Conversation
- Add support for parsing code/code_block tags in rich text posts - Add support for parsing pre (preformatted text) tags with language - Handle share_chat message type for forwarded/merged messages Fixes: openclaw#28578
- Add resolveSystemdScope() to detect if service should run in user or system scope - Update resolveSystemdUnitPathForName() to use /etc/systemd/system for system scope - Add OPENCLAW_SYSTEMD_SCOPE env var to configure scope (default: user) fix(delivery-queue): enhance Telegram 'bot was kicked' error with helpful hints - Add enhanceErrorMessageWithHint() to provide context for forum topic errors - The 'bot was kicked' error is misleading when posting to locked forum topics - Now includes a hint explaining the topic may restrict posting to admins only Closes openclaw#29048 Closes openclaw#29051
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c730dfec2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const scope = resolveSystemdScope(env); | ||
| if (scope === "system") { | ||
| return path.posix.join("/etc/systemd/system", `${name}.service`); |
There was a problem hiding this comment.
Use matching systemctl scope for system units
When resolveSystemdUnitPathForName switches to /etc/systemd/system for OPENCLAW_SYSTEMD_SCOPE=system, the rest of src/daemon/systemd.ts still hard-codes systemctl --user (for example in assertSystemdAvailable and the install/manage flows), so system-scoped units are written to the system unit directory but controlled through the user manager. systemctl --help explicitly distinguishes --system (“Connect to system manager”) from --user (“Connect to user service manager”), so this path produces unit-not-found/reload failures whenever system scope is selected.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR bundles three separate fixes into a single commit:
The delivery-queue enhancement addresses issue #29048 by detecting when a delivery target includes a forum topic ( One logical issue found: the Confidence Score: 4/5
Last reviewed commit: 1c730df |
| const hasTopic = | ||
| target.includes(":topic:") || (threadId !== undefined && threadId !== null && threadId !== ""); |
There was a problem hiding this comment.
threadId=0 incorrectly treated as valid. 0 !== "" evaluates to true, causing the hint to appear even though 0 isn't a valid Telegram thread ID.
| const hasTopic = | |
| target.includes(":topic:") || (threadId !== undefined && threadId !== null && threadId !== ""); | |
| const hasTopic = target.includes(":topic:") || Boolean(threadId); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/infra/outbound/delivery-queue.ts
Line: 410-411
Comment:
threadId=0 incorrectly treated as valid. `0 !== ""` evaluates to true, causing the hint to appear even though 0 isn't a valid Telegram thread ID.
```suggestion
const hasTopic = target.includes(":topic:") || Boolean(threadId);
```
How can I resolve this? If you propose a fix, please make it concise.When provider is 'local', doctor only checked local.modelPath for the model file path. But users can also configure the model via the generic 'model' field (e.g., hf:ggml-org/embeddinggemma-300m-qat-q8_0). This fix adds a hasModelAsLocalPath() function that checks if the model field contains hf: or http(s): paths, which are valid for local provider. Fixes openclaw#29099
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 416c88017a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // provider === "auto": check all providers in resolution order | ||
| if (hasLocalEmbeddings(resolved.local)) { | ||
| // Also check the model field for hf:/http(s): paths which work with local provider | ||
| if (hasLocalEmbeddings(resolved.local) || hasModelAsLocalPath(resolved.model)) { |
There was a problem hiding this comment.
Don’t treat
memorySearch.model as local readiness in auto mode
The new hasModelAsLocalPath(resolved.model) short-circuit in auto mode can suppress the doctor warning even when no embedding provider is actually usable. If provider: "auto", local.modelPath is unset, and model is set to an hf:/http string, this branch returns early, but runtime auto-selection does not use memorySearch.model for local readiness (it only checks local.modelPath before trying local embeddings), so the gateway can still run without any embedding provider while openclaw doctor reports no issue.
Useful? React with 👍 / 👎.
|
This pull request has been automatically marked as stale due to inactivity. |
Summary
When a cron job is configured to deliver to a Telegram Forum topic that restricts posting (e.g.
topic:1/ General), the bot receives a403: Forbidden: bot was kicked from the supergroup chaterror. This message is identical to the error when the bot is actually removed from the group, making root cause analysis extremely difficult.Fix
This PR adds a helper function
enhanceErrorMessageWithHint()that::topic:syntax) or has a threadId setTesting
Closes #29048