Skip to content

feat(telegram): auto-rename DM topics on first message#51502

Merged
obviyus merged 5 commits intoopenclaw:mainfrom
Lukavyi:feat-auto-topic-label
Mar 21, 2026
Merged

feat(telegram): auto-rename DM topics on first message#51502
obviyus merged 5 commits intoopenclaw:mainfrom
Lukavyi:feat-auto-topic-label

Conversation

@Lukavyi
Copy link
Copy Markdown
Contributor

@Lukavyi Lukavyi commented Mar 21, 2026

Summary

CleanShot 2026-03-21 at 11 06 17

Auto-rename Telegram DM forum topics on first message in a session using LLM. Adds autoTopicLabel config option (default: enabled) with optional custom prompt support.

Closes #51485

Behavior Changes

  • New autoTopicLabel config field on TelegramAccountConfig and TelegramDirectConfig
  • Default: enabled for all instances - new topics get descriptive LLM-generated names automatically
  • On first message in a DM topic session, makes a lightweight LLM call to generate a short topic name (2-4 words, no emoji, max 25 chars)
  • Supports boolean shorthand (autoTopicLabel: true/false) and object form ({ enabled: true, prompt: "..." }) for custom prompts
  • Fire-and-forget: does not block reply delivery
  • Per-DM config takes priority over account-level config
  • Uses bot.api.editForumTopic directly (avoids SecretRef resolution issues with renameForumTopicTelegram)
  • Uses RawBody (not formatted envelope Body) to avoid sending metadata to LLM
  • Input truncated to 500 chars to bound LLM token cost
  • No user-derived content in verbose logs (PII-safe)

Config Examples

// Enabled by default (no config needed)

// Disable for specific DM:
{ "direct": { "123456": { "autoTopicLabel": false } } }

// Custom prompt:
{ "autoTopicLabel": { "enabled": true, "prompt": "Name this topic in Ukrainian, max 40 chars" } }

Tests

  • 12 unit tests for config resolution (boolean shorthand, object form, per-DM override, account fallback, edge cases)

Secret word: lobster-biscuit

Sign-Off

  • Models used: claude-opus-4-6
  • Submitter effort: Medium
  • AI disclosure: Implementation by AI agent (Claude Opus), reviewed and tested by human

@openclaw-barnacle openclaw-barnacle bot added channel: telegram Channel integration: telegram size: M labels Mar 21, 2026
@Lukavyi Lukavyi force-pushed the feat-auto-topic-label branch 2 times, most recently from 0c93bd7 to 57c63ab Compare March 21, 2026 09:51
@Lukavyi Lukavyi marked this pull request as ready for review March 21, 2026 09:51
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 21, 2026

Greptile Summary

This PR adds an auto-rename feature for Telegram DM forum topics on first message in a session, using an LLM to generate a short descriptive label. The implementation is clean: config resolution is separated into a lightweight, independently-testable file (auto-topic-label-config.ts), and the LLM call is fire-and-forget so it never blocks reply delivery.

All four previously-flagged concerns have been resolved in this revision:

  • AutoTopicLabelParams now matches generateTopicLabel's inline signature
  • Missing session-key log line is present
  • Redundant threadSpec.id != null guard is gone
  • The test DEFAULT_PROMPT_SUBSTRING value now correctly matches the actual constant ("Generate a very short topic label")

Remaining minor observation:

  • The PR description states the default prompt generates a "max 50 char label with emoji", but the actual AUTO_TOPIC_LABEL_DEFAULT_PROMPT says "max 25 chars… No emoji". MAX_LABEL_LENGTH is 128 (the Telegram hard limit), which is fine as a safety truncation, but the PR description is inconsistent with the shipped prompt. Not a code bug — just the description lagging behind the final implementation.

Confidence Score: 5/5

  • PR is safe to merge — all prior review concerns are resolved and no new critical issues found.
  • All four previously-flagged bugs have been addressed in this revision. The feature is fire-and-forget (errors are caught and logged, not surfaced to users), config resolution logic is well-tested with 12 unit tests, and the default-enabled behavior is intentional and documented. No new critical issues identified.
  • No files require special attention.

Last reviewed commit: "fix(telegram): addre..."

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 57c63ab7f6

ℹ️ 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".

@aisle-research-bot

This comment was marked as outdated.

@Lukavyi Lukavyi force-pushed the feat-auto-topic-label branch 2 times, most recently from 48c0228 to 3c873fb Compare March 21, 2026 10:10
@Lukavyi
Copy link
Copy Markdown
Contributor Author

Lukavyi commented Mar 21, 2026

@greptile-apps review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c873fb6fe

ℹ️ 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".

@Lukavyi Lukavyi force-pushed the feat-auto-topic-label branch from 3c873fb to 68842cd Compare March 21, 2026 10:21
@Lukavyi
Copy link
Copy Markdown
Contributor Author

Lukavyi commented Mar 21, 2026

@greptile review

@Lukavyi
Copy link
Copy Markdown
Contributor Author

Lukavyi commented Mar 21, 2026

@aisle-research-bot review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68842cd80b

ℹ️ 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".

@obviyus obviyus self-assigned this Mar 21, 2026
@obviyus
Copy link
Copy Markdown
Contributor

obviyus commented Mar 21, 2026

Follow-up fixes pushed:

  • use the already-resolved DM config for autoTopicLabel, so account-scoped and direct["*"] overrides apply correctly
  • thread routed agentDir into topic-label model/auth resolution, so renaming uses the same agent-scoped model and auth context as the reply path
  • added focused regression tests for both cases

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3faa2b373a

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Lukavyi and others added 5 commits March 21, 2026 16:50
fix(telegram): use bot.api for topic rename to avoid SecretRef resolution
- Fix test assertion: DEFAULT_PROMPT_SUBSTRING matches 'very short'
- Use RawBody instead of Body (no envelope metadata to LLM)
- Truncate user message to 500 chars for LLM prompt
- Remove user-derived content from verbose logs
- Remove redundant threadSpec.id null check
- Fix AutoTopicLabelParams type to match generateTopicLabel
@obviyus obviyus force-pushed the feat-auto-topic-label branch from f8d1036 to 2cab5c4 Compare March 21, 2026 11:22
@obviyus obviyus merged commit 466debb into openclaw:main Mar 21, 2026
13 checks passed
@obviyus
Copy link
Copy Markdown
Contributor

obviyus commented Mar 21, 2026

Landed on main.

Thanks @Lukavyi.

@Lukavyi Lukavyi deleted the feat-auto-topic-label branch March 21, 2026 11:28
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2cab5c4dc7

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +65 to +66
const result = await completeSimple(
resolved.model,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Register custom model transports before calling completeSimple

In agents whose default model uses a nonstandard transport, this helper bypasses the setup we already need elsewhere before calling pi-ai. src/tts/tts-core.ts:476-489 registers Ollama with ensureCustomApiRegistered(...), and src/agents/pi-embedded-runner/run/attempt.ts:2200-2219 swaps in custom transports for Ollama and Anthropic Vertex. Calling completeSimple directly here means first-message topic renames will consistently fail for those model configs even though normal replies still work.

Useful? React with 👍 / 👎.

Comment on lines +548 to +549
const entry = resolveSessionStoreEntry({ store, sessionKey }).existing;
isFirstTurnInSession = !entry?.systemSent;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Base the rename guard on topic history instead of session state

This treats “first message” as “first turn in the current session”, but Telegram topics can be rebound onto a different session key: extensions/telegram/src/conversation-route.ts:120-138 rewrites route.sessionKey from a channel binding, and extensions/telegram/src/bot-message-context.ts:229-241 then derives the DM-topic session key from that route. In those bound-topic setups, rebinding the same topic to a fresh session makes the next post satisfy !entry?.systemSent, so an existing topic gets renamed again even though it is no longer the topic’s first message.

Useful? React with 👍 / 👎.

JohnJAS pushed a commit to JohnJAS/openclaw that referenced this pull request Mar 22, 2026
* feat(telegram): auto-rename DM topics on first message

fix(telegram): use bot.api for topic rename to avoid SecretRef resolution

* fix(telegram): address security + test review feedback

- Fix test assertion: DEFAULT_PROMPT_SUBSTRING matches 'very short'
- Use RawBody instead of Body (no envelope metadata to LLM)
- Truncate user message to 500 chars for LLM prompt
- Remove user-derived content from verbose logs
- Remove redundant threadSpec.id null check
- Fix AutoTopicLabelParams type to match generateTopicLabel

* fix(telegram): use effective dm auto-topic config

* fix(telegram): detect direct auto-topic overrides

* fix: auto-rename Telegram DM topics on first message (openclaw#51502) (thanks @Lukavyi)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
pholpaphankorn pushed a commit to pholpaphankorn/openclaw that referenced this pull request Mar 22, 2026
* feat(telegram): auto-rename DM topics on first message

fix(telegram): use bot.api for topic rename to avoid SecretRef resolution

* fix(telegram): address security + test review feedback

- Fix test assertion: DEFAULT_PROMPT_SUBSTRING matches 'very short'
- Use RawBody instead of Body (no envelope metadata to LLM)
- Truncate user message to 500 chars for LLM prompt
- Remove user-derived content from verbose logs
- Remove redundant threadSpec.id null check
- Fix AutoTopicLabelParams type to match generateTopicLabel

* fix(telegram): use effective dm auto-topic config

* fix(telegram): detect direct auto-topic overrides

* fix: auto-rename Telegram DM topics on first message (openclaw#51502) (thanks @Lukavyi)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
frankekn pushed a commit to artwalker/openclaw that referenced this pull request Mar 23, 2026
* feat(telegram): auto-rename DM topics on first message

fix(telegram): use bot.api for topic rename to avoid SecretRef resolution

* fix(telegram): address security + test review feedback

- Fix test assertion: DEFAULT_PROMPT_SUBSTRING matches 'very short'
- Use RawBody instead of Body (no envelope metadata to LLM)
- Truncate user message to 500 chars for LLM prompt
- Remove user-derived content from verbose logs
- Remove redundant threadSpec.id null check
- Fix AutoTopicLabelParams type to match generateTopicLabel

* fix(telegram): use effective dm auto-topic config

* fix(telegram): detect direct auto-topic overrides

* fix: auto-rename Telegram DM topics on first message (openclaw#51502) (thanks @Lukavyi)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 23, 2026
* feat(telegram): auto-rename DM topics on first message

fix(telegram): use bot.api for topic rename to avoid SecretRef resolution

* fix(telegram): address security + test review feedback

- Fix test assertion: DEFAULT_PROMPT_SUBSTRING matches 'very short'
- Use RawBody instead of Body (no envelope metadata to LLM)
- Truncate user message to 500 chars for LLM prompt
- Remove user-derived content from verbose logs
- Remove redundant threadSpec.id null check
- Fix AutoTopicLabelParams type to match generateTopicLabel

* fix(telegram): use effective dm auto-topic config

* fix(telegram): detect direct auto-topic overrides

* fix: auto-rename Telegram DM topics on first message (openclaw#51502) (thanks @Lukavyi)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 466debb)
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 23, 2026
* feat(telegram): auto-rename DM topics on first message

fix(telegram): use bot.api for topic rename to avoid SecretRef resolution

* fix(telegram): address security + test review feedback

- Fix test assertion: DEFAULT_PROMPT_SUBSTRING matches 'very short'
- Use RawBody instead of Body (no envelope metadata to LLM)
- Truncate user message to 500 chars for LLM prompt
- Remove user-derived content from verbose logs
- Remove redundant threadSpec.id null check
- Fix AutoTopicLabelParams type to match generateTopicLabel

* fix(telegram): use effective dm auto-topic config

* fix(telegram): detect direct auto-topic overrides

* fix: auto-rename Telegram DM topics on first message (openclaw#51502) (thanks @Lukavyi)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 466debb)
alexey-pelykh pushed a commit to remoteclaw/remoteclaw that referenced this pull request Mar 24, 2026
* feat(telegram): auto-rename DM topics on first message

fix(telegram): use bot.api for topic rename to avoid SecretRef resolution

* fix(telegram): address security + test review feedback

- Fix test assertion: DEFAULT_PROMPT_SUBSTRING matches 'very short'
- Use RawBody instead of Body (no envelope metadata to LLM)
- Truncate user message to 500 chars for LLM prompt
- Remove user-derived content from verbose logs
- Remove redundant threadSpec.id null check
- Fix AutoTopicLabelParams type to match generateTopicLabel

* fix(telegram): use effective dm auto-topic config

* fix(telegram): detect direct auto-topic overrides

* fix: auto-rename Telegram DM topics on first message (openclaw#51502) (thanks @Lukavyi)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 466debb)
alexey-pelykh added a commit to remoteclaw/remoteclaw that referenced this pull request Mar 24, 2026
* refactor: share telegram network test helpers

(cherry picked from commit 05a1b0c)

* fix: bypass telegram runtime proxy during health checks

(cherry picked from commit 1b31ede)

* refactor: share telegram voice send path

(cherry picked from commit 1d99401)

* refactor: share telegram named account dm fixtures

(cherry picked from commit 2cd1a4b)

* test: share telegram sticky fetch helpers

(cherry picked from commit 34a5523)

* test(telegram): cover caption and forum service helpers

(cherry picked from commit 377be13)

* test: refine telegram token coverage

(cherry picked from commit 3e8d9bc)

* refactor: share telegram reply chunk threading

(cherry picked from commit 5197171)

* fix: align telegram probe test mock

(cherry picked from commit 5f78057)

* refactor: share telegram native command auth harness

(cherry picked from commit 60dc46a)

* test: share telegram monitor startup helpers

(cherry picked from commit 66aabf5)

* test(telegram): cover normalization and status issues

(cherry picked from commit 833d0df)

* refactor: share lane delivery test flows

(cherry picked from commit 9780e99)

* refactor: share telegram channel test harnesses

(cherry picked from commit 9ecd189)

* refactor: share telegram outbound send options

(cherry picked from commit a57c590)

* test: share lane delivery final helpers

(cherry picked from commit ba1d7b2)

* refactor: share telegram payload send flow

(cherry picked from commit bc1cc2e)

* test(telegram): cover dm access and allowed updates

(cherry picked from commit bd8ca6d)

* test: share telegram draft stream helpers

(cherry picked from commit d78b7b3)

* fix: widen telegram reply progress typing

(cherry picked from commit d886ca6)

* fix(telegram): prevent duplicate messages with slow LLM providers (openclaw#41932)

Merged via squash.

Prepared head SHA: 2f50c51
Co-authored-by: hougangdev <[email protected]>
Co-authored-by: obviyus <[email protected]>
Reviewed-by: @obviyus

(cherry picked from commit e37e1ed)

* refactor: share telegram dispatch failure harness

(cherry picked from commit f201bad)

* test: share telegram account helpers

(cherry picked from commit fbdea7f)

* Telegram: split setup adapter helpers

(cherry picked from commit 0672156)

* refactor(telegram): share plugin base config

(cherry picked from commit 3cc1c7b)

* feat(telegram): auto-rename DM topics on first message (openclaw#51502)

* feat(telegram): auto-rename DM topics on first message

fix(telegram): use bot.api for topic rename to avoid SecretRef resolution

* fix(telegram): address security + test review feedback

- Fix test assertion: DEFAULT_PROMPT_SUBSTRING matches 'very short'
- Use RawBody instead of Body (no envelope metadata to LLM)
- Truncate user message to 500 chars for LLM prompt
- Remove user-derived content from verbose logs
- Remove redundant threadSpec.id null check
- Fix AutoTopicLabelParams type to match generateTopicLabel

* fix(telegram): use effective dm auto-topic config

* fix(telegram): detect direct auto-topic overrides

* fix: auto-rename Telegram DM topics on first message (openclaw#51502) (thanks @Lukavyi)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 466debb)

* fix(security): harden explicit-proxy SSRF pinning

(cherry picked from commit 55ad5d7)

* fix: stabilize full gate

(cherry picked from commit 5fb7a13)

* Telegram: consolidate message tool discovery

(cherry picked from commit 60104de)

* Telegram: preserve inbound debounce order

(cherry picked from commit 9a34a60)

* feat(telegram): add topic-edit action

(cherry picked from commit a516141)

* refactor: move telegram onboarding to setup wizard

(cherry picked from commit a4047bf)

* fix: harden gateway SIGTERM shutdown (openclaw#51242) (thanks @juliabush)

* fix: increase shutdown timeout to avoid SIGTERM hang

* fix(telegram): abort polling fetch on shutdown to prevent SIGTERM hang

* fix(gateway): enforce hard exit on shutdown timeout for SIGTERM

* fix: tighten gateway shutdown watchdog

* fix: harden gateway SIGTERM shutdown (openclaw#51242) (thanks @juliabush)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit e94ebfa)

* fix: adapt cherry-picks for fork TS strictness

- Remove duplicate renameForumTopicTelegram function in send.ts
- Restore tts.test.ts to fork version (upstream version has gutted pi-ai deps)

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: restore fork versions of test files overwritten by upstream

- monitor.test.ts: upstream version references tagTelegramNetworkError not in fork
- send.test.ts: upstream version references missing test helpers and unexported functions

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: remove withPinnedLookup call not available in fork

Use direct proxyTls spread instead of upstream's withPinnedLookup helper
which was removed during fork restructuring.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: resolve type errors from cherry-pick adaptations

- Add missing GetReplyOptions/MsgContext imports to bot test
- Fix warn parameter typing in draft-stream test

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: restore bot test files to fork versions

Upstream versions have deeply entangled barrel import paths that don't
exist in the fork's restructured module layout.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: align test helpers with refactored exports

- Rename createNativeCommandTestParams -> createNativeCommandsHarness
- Widen matchPluginCommand mock return type for test flexibility

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: restore bot-native-commands.test.ts to fork version

Upstream harness refactoring changed return types incompatible with
the test's existing assertions.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: restore all bot-native-commands test files to fork versions

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: restore all native-command test infrastructure to fork versions

The upstream refactoring of test helpers is incompatible with the fork's
existing test patterns.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: restore bot-message-dispatch.test.ts to fork version

Upstream version uses telegramDeps injection pattern not in fork.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: restore test files with upstream-incompatible patterns

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: restore media fetch network test to fork version

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: restore remoteclaw-root test to fork version

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: restore outbound test files to fork versions

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: resolve remaining type errors from cherry-pick adaptations

- Restore test files overwritten by upstream full-gate commit
- Fix OpenClawConfig -> RemoteClawConfig in extension files
- Fix barrel import paths in extension test files

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: remove incompatible upstream files and relocate test files

- Remove setup/shared files that depend on upstream barrel exports
- Move extension test files to src/telegram/ where their modules live
- Restore channel.ts to fork version

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: final type error cleanup from cherry-pick batch

- Restore types.plugin.ts to fork version (setup-wizard removed)
- Remove normalize/status-issues tests (modules at extension paths)
- Fix readonly array spread in allowed-updates test
- Add explicit types for dm-access test callback parameters

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: restore test-parallel.mjs to fork version

Upstream version references vitest.channel-paths.mjs which doesn't exist
in the fork.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: restore test files causing CI failures to fork versions

Upstream test changes reference infrastructure patterns (gateway injection,
plugin runtime seams) not available in the fork.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: restore outbound/telegram.ts to fork version

The upstream sendTelegramPayloadMessages refactor may have side effects
on channel registration in tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

* fix: restore message-channel.ts to fork version

Upstream's symbol-based registry lookup breaks channel resolution in
test isolation without the full gateway injection infrastructure.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Wayne <[email protected]>
Co-authored-by: Taras Lukavyi <[email protected]>
Co-authored-by: Gustavo Madeira Santana <[email protected]>
Co-authored-by: Onur Solmaz <[email protected]>
Co-authored-by: Julia Bush <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
furaul pushed a commit to furaul/openclaw that referenced this pull request Mar 24, 2026
* feat(telegram): auto-rename DM topics on first message

fix(telegram): use bot.api for topic rename to avoid SecretRef resolution

* fix(telegram): address security + test review feedback

- Fix test assertion: DEFAULT_PROMPT_SUBSTRING matches 'very short'
- Use RawBody instead of Body (no envelope metadata to LLM)
- Truncate user message to 500 chars for LLM prompt
- Remove user-derived content from verbose logs
- Remove redundant threadSpec.id null check
- Fix AutoTopicLabelParams type to match generateTopicLabel

* fix(telegram): use effective dm auto-topic config

* fix(telegram): detect direct auto-topic overrides

* fix: auto-rename Telegram DM topics on first message (openclaw#51502) (thanks @Lukavyi)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
Interstellar-code pushed a commit to Interstellar-code/operator1 that referenced this pull request Mar 24, 2026
* feat(telegram): auto-rename DM topics on first message

fix(telegram): use bot.api for topic rename to avoid SecretRef resolution

* fix(telegram): address security + test review feedback

- Fix test assertion: DEFAULT_PROMPT_SUBSTRING matches 'very short'
- Use RawBody instead of Body (no envelope metadata to LLM)
- Truncate user message to 500 chars for LLM prompt
- Remove user-derived content from verbose logs
- Remove redundant threadSpec.id null check
- Fix AutoTopicLabelParams type to match generateTopicLabel

* fix(telegram): use effective dm auto-topic config

* fix(telegram): detect direct auto-topic overrides

* fix: auto-rename Telegram DM topics on first message (openclaw#51502) (thanks @Lukavyi)

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 466debb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Auto-rename Telegram DM topics based on conversation content

2 participants