Skip to content

fix(ton-trading-bot): add tests, fix lint warnings, register in README#40

Merged
xlabtg merged 3 commits intoxlabtg:mainfrom
konard:issue-39-f70900fd5864
Mar 24, 2026
Merged

fix(ton-trading-bot): add tests, fix lint warnings, register in README#40
xlabtg merged 3 commits intoxlabtg:mainfrom
konard:issue-39-f70900fd5864

Conversation

@konard
Copy link

@konard konard commented Mar 24, 2026

Summary

Fixes #39 — the TON Trading Bot plugin was installed but the agent couldn't discover or use it.

Root causes found and fixed

  1. Plugin not listed in README — The agent's marketplace and documentation (README.md) did not include ton-trading-bot in 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).

  2. 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).

  3. ESLint warnings — The context parameter was declared but unused in 5 of the 6 execute functions. Renamed to _context to match the project's no-unused-vars rule (only ton_trading_execute_swap uses context.chatId, so it keeps the original name).

What was verified as already correct

  • manifest.json — all required fields present, id matches folder name, tools list matches index.js
  • registry.json — plugin is correctly registered
  • Plugin structure — manifest, migrate, and tools(sdk) exports are all valid
  • sdk.storage, sdk.db, sdk.ton.dex usage — all follow the SDK pattern correctly

Tests added (plugins/ton-trading-bot/tests/index.test.js)

Suite Tests
manifest 5
tools export + migrate 6
ton_trading_get_market_data 5
ton_trading_get_portfolio 3
ton_trading_validate_trade 6
ton_trading_simulate_trade 5
ton_trading_execute_swap 5
ton_trading_record_trade 5
Total 35

All 35 new tests pass. All 33 pre-existing ton-bridge tests continue to pass (68 total).

Test plan

  • npm test — 68/68 tests pass
  • node scripts/validate-plugins.mjs — ton-trading-bot: 6 tool(s) validated ✓
  • eslint plugins/ton-trading-bot/**/*.js — 0 errors, 0 warnings
  • Plugin appears in README DeFi & Trading table

🤖 Generated with Claude Code

konard and others added 2 commits March 24, 2026 01:03
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>
@konard konard changed the title [WIP] Ton Trading Bot verification does not contain integration errors with the agent fix(ton-trading-bot): add tests, fix lint warnings, register in README Mar 24, 2026
@konard konard marked this pull request as ready for review March 24, 2026 01:11
@konard
Copy link
Author

konard commented Mar 24, 2026

🤖 Solution Draft Log

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

💰 Cost estimation:

  • Public pricing estimate: $3.866818
  • Calculated by Anthropic: $2.638141 USD
  • Difference: $-1.228676 (-31.77%)

🤖 Models used:

  • Tool: Claude
  • Requested: sonnet
  • Model: Claude Sonnet 4.6 (claude-sonnet-4-6)

📎 Log file uploaded as Gist (1791KB)


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

@konard
Copy link
Author

konard commented Mar 24, 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 3dbeeed into xlabtg:main Mar 24, 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 Trading Bot verification does not contain integration errors with the agent

2 participants