fix(ton-trading-bot): add tests, fix lint warnings, register in README#40
Merged
xlabtg merged 3 commits intoxlabtg:mainfrom Mar 24, 2026
Merged
fix(ton-trading-bot): add tests, fix lint warnings, register in README#40xlabtg 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#39
- Add comprehensive unit tests (35 tests covering all 6 tools) with mocked SDK — no real network or disk access required - Fix unused `context` parameter lint warnings in index.js execute functions (rename to `_context` per eslint no-unused-vars rule) - Add ton-trading-bot to README.md DeFi & Trading table so the agent can discover it via the marketplace and documentation - Update README plugin/tool count badges (25→26 plugins, 183→189 tools) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This reverts commit 8bd325a.
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 (1791KB)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 #39 — the TON Trading Bot plugin was installed but the agent couldn't discover or use it.
Root causes found and fixed
Plugin not listed in README — The agent's marketplace and documentation (
README.md) did not includeton-trading-botin the Available Plugins table. This is the primary reason the agent couldn't discover it via the web UI or docs. Fixed by adding it to the DeFi & Trading section and updating the badge counts (25→26 plugins, 183→189 tools).No automated tests — The plugin had no
tests/folder, making it impossible to verify correctness automatically. Added 35 unit tests covering all 6 tools with a mocked SDK (no real network or disk access).ESLint warnings — The
contextparameter was declared but unused in 5 of the 6executefunctions. Renamed to_contextto match the project'sno-unused-varsrule (onlyton_trading_execute_swapusescontext.chatId, so it keeps the original name).What was verified as already correct
manifest.json— all required fields present,idmatches folder name, tools list matchesindex.jsregistry.json— plugin is correctly registeredmanifest,migrate, andtools(sdk)exports are all validsdk.storage,sdk.db,sdk.ton.dexusage — all follow the SDK pattern correctlyTests added (
plugins/ton-trading-bot/tests/index.test.js)ton_trading_get_market_dataton_trading_get_portfolioton_trading_validate_tradeton_trading_simulate_tradeton_trading_execute_swapton_trading_record_tradeAll 35 new tests pass. All 33 pre-existing
ton-bridgetests continue to pass (68 total).Test plan
npm test— 68/68 tests passnode scripts/validate-plugins.mjs— ton-trading-bot: 6 tool(s) validated ✓eslint plugins/ton-trading-bot/**/*.js— 0 errors, 0 warnings🤖 Generated with Claude Code