fix(ton-bridge): clean up plugin and document agent-side duplication bug#30
Merged
xlabtg merged 3 commits intoxlabtg:mainfrom Mar 23, 2026
Merged
fix(ton-bridge): clean up plugin and document agent-side duplication bug#30xlabtg merged 3 commits intoxlabtg:mainfrom
xlabtg merged 3 commits intoxlabtg:mainfrom
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: xlabtg#29
- Remove unused createRequire import from test file - Align registry.json description with manifest.json for consistency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit 095df4e.
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 (2123KB)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.
Summary
Fixes #29
Plugin-side fixes (this PR)
createRequireimport from test file (lint cleanup)registry.jsondescription withmanifest.jsonfor consistencyInvestigation findings
After thorough analysis, the ton-bridge plugin itself is correctly structured and fully compliant with the teleton plugin standard:
toolsas a function (SDK pattern) ✓ton_bridge_open,ton_bridge_about,ton_bridge_custom_message) have validname,description,parameters, andexecute✓manifest.jsonhas all required fields ✓export const manifesthas correctsdkVersionanddefaultConfig✓PluginSDKErrorsupport ✓Root cause of duplication bug (agent-side)
The plugin duplication on restart is a bug in
xlabtg/teleton-agent, not in the plugin itself. Specifically:The fork's
startAgent()insrc/index.tsis missing thebuiltinModuleCountproperty and module array truncation that the original (TONresistor/teleton-agent) has.What happens on restart:
stopAgent()runs — callsmod.stop()on all modules but does not remove plugin tools from the registry and does not truncate thethis.modulesarraystartAgent()runs again — callsloadEnhancedPlugins()which discovers the same pluginsthis.modules.push(mod)appends duplicates to the arrayregisterPluginTools()silently skips individual tools that already exist (if (this.tools.has(tool.name)) continue), but overwritespluginToolNameswith an empty array (since all tools were skipped)pluginToolNamesincorrectly shows 0 tools for the pluginFix needed in
xlabtg/teleton-agent:Add module array truncation before re-loading plugins (matching the original repo):
And in
registerPluginTools(), callremovePluginTools()before re-registering:This fix should be applied in the xlabtg/teleton-agent repository.
Test plan
npm run validate)npm run lint)🤖 Generated with Claude Code