fix(ton-bridge): add fallback for missing customMessage in ton_bridge_custom_message#32
Merged
xlabtg merged 3 commits intoxlabtg:mainfrom Mar 23, 2026
Merged
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: xlabtg#31
…_custom_message When the LLM calls ton_bridge_custom_message without providing customMessage (despite it being in the JSON Schema required array), params.customMessage is undefined and gets passed directly to sdk.telegram.sendMessage, causing a crash. Add a ?? fallback chain: params.customMessage ?? sdk.pluginConfig?.customMessage ?? hardcoded default, consistent with how ton_bridge_open handles params.message. Closes xlabtg#31 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This reverts commit 18e49bb.
Author
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
🤖 Models used:
📎 Log file uploaded as Gist (449KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
Author
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ton_bridge_custom_messagehascustomMessagelisted asrequiredin its JSON Schema parameters, but LLMs can and do call tools without providing required fields. WhencustomMessageis omitted,params.customMessageisundefined, which gets passed directly tosdk.telegram.sendMessage(chatId, undefined, ...)— causing a crash.Fix
Add a
??fallback chain (per CONTRIBUTING.md guidelines — use??not||) in theexecutefunction:This is consistent with how
ton_bridge_openalready handlesparams.message.The fallback priority is:
params.customMessagesdk.pluginConfig.customMessageTests
Added 2 new unit tests:
sdk.pluginConfig.customMessagewhen param is missingAll 27 tests pass.
Closes #31