Skip to content

fix(ton-bridge): send button directly via sdk.telegram.sendMessage, remove buttonEmoji#24

Merged
xlabtg merged 3 commits intoxlabtg:mainfrom
konard:issue-23-b4bb9c4e329a
Mar 19, 2026
Merged

fix(ton-bridge): send button directly via sdk.telegram.sendMessage, remove buttonEmoji#24
xlabtg merged 3 commits intoxlabtg:mainfrom
konard:issue-23-b4bb9c4e329a

Conversation

@konard
Copy link

@konard konard commented Mar 19, 2026

Summary

Fixes #23 — the ton-bridge plugin was not correctly sending inline buttons in DMs, groups, and channels, and the emoji on the button could not be removed by the agent.

Root causes found

  1. Plugin returned reply_markup in tool data instead of sending directly — The three tools returned { content, reply_markup } as data for the agent/runtime to interpret. The runtime does not automatically convert this into an actual Telegram message with buttons, so buttons were never sent correctly (especially in groups and channels).

  2. No way for the agent to remove emoji from the button — The button label was built from buttonEmoji + buttonText in config. There was no tool parameter to control the label, so the LLM had no way to honor a user request like "open TON Bridge, no emoji on the button".

  3. Hardcoded buttonEmoji in defaultConfig — Emoji was opt-out rather than opt-in, causing the agent to always include it unless the config was manually changed.

Changes

  • All three tools now call sdk.telegram.sendMessage() with an inlineKeyboard URL button, sending the message directly to the current chat — works in DMs, groups, and channels
  • Added optional buttonText parameter to each tool so the LLM can control the button label (including omitting emoji) per call
  • Removed buttonEmoji from defaultConfig and inline manifest — emoji is now opt-in via the buttonText parameter
  • Used PluginSDKError-aware error handling as per patterns.md
  • Updated README to document new behavior and buttonText parameter

Test plan

  • npm run validate passes — ton-bridge: 3 tool(s) validated
  • npm run lint passes — 0 errors

🤖 Generated with Claude Code

konard and others added 2 commits March 19, 2026 11:14
Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: xlabtg#23
…emove buttonEmoji

Previously the plugin returned reply_markup in tool data and relied on
the runtime/agent to render the button, which did not work correctly
in DMs, groups, or channels.

Changes:
- All three tools now call sdk.telegram.sendMessage() with an
  inlineKeyboard URL button, sending the message directly to the chat
- Add optional buttonText parameter to each tool so the LLM can
  control the button label (including omitting emoji) per call
- Remove buttonEmoji from defaultConfig and inline manifest — emoji
  should be opt-in via the buttonText parameter, not hardcoded
- Use PluginSDKError-aware error handling as per patterns.md
- Update README to document new behavior and buttonText parameter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] Проверить плагин ton-bridge fix(ton-bridge): send button directly via sdk.telegram.sendMessage, remove buttonEmoji Mar 19, 2026
@konard konard marked this pull request as ready for review March 19, 2026 11:18
@konard
Copy link
Author

konard commented Mar 19, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $1.296171
  • Calculated by Anthropic: $0.758452 USD
  • Difference: $-0.537719 (-41.49%)

🤖 Models used:

  • Tool: Claude
  • Requested: sonnet
  • Main model: Claude Sonnet 4.6 (ID: claude-sonnet-4-6, Anthropic, cutoff: 2025-08)
    📎 Log file uploaded as Gist (696KB)
    🔗 View complete solution draft log

Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Author

konard commented Mar 19, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@xlabtg xlabtg merged commit bc85cab into xlabtg:main Mar 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Проверить плагин ton-bridge

2 participants