Skip to content

Conversation

@Lederstrumpf
Copy link
Contributor

@Lederstrumpf Lederstrumpf commented Oct 15, 2025

without this change:

@polkadot-agent-kit/sdk:test:integration:mainnet: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
@polkadot-agent-kit/sdk:test:integration:mainnet:
@polkadot-agent-kit/sdk:test:integration:mainnet:  FAIL  tests/integration-tests/sdk.mainnet.itest.ts > PolkadotAgentKit Integration with OllamaAgent > should call swap_tokens tool for Polkadot to Polkadot Asset Hub swap
@polkadot-agent-kit/sdk:test:integration:mainnet: AssertionError: expected { amount: '0.1', …(4) } to match object { amount: '0.1', …(4) }
@polkadot-agent-kit/sdk:test:integration:mainnet:
@polkadot-agent-kit/sdk:test:integration:mainnet: - Expected
@polkadot-agent-kit/sdk:test:integration:mainnet: + Received
@polkadot-agent-kit/sdk:test:integration:mainnet:
@polkadot-agent-kit/sdk:test:integration:mainnet:   {
@polkadot-agent-kit/sdk:test:integration:mainnet:     "amount": "0.1",
@polkadot-agent-kit/sdk:test:integration:mainnet:     "currencyFrom": "DOT",
@polkadot-agent-kit/sdk:test:integration:mainnet:     "currencyTo": "USDt",
@polkadot-agent-kit/sdk:test:integration:mainnet: -   "from": "Polkadot",
@polkadot-agent-kit/sdk:test:integration:mainnet: -   "to": "AssetHubPolkadot",
@polkadot-agent-kit/sdk:test:integration:mainnet: +   "from": "polkadot",
@polkadot-agent-kit/sdk:test:integration:mainnet: +   "to": "polkadot_asset_hub",
@polkadot-agent-kit/sdk:test:integration:mainnet:   }
@polkadot-agent-kit/sdk:test:integration:mainnet:
@polkadot-agent-kit/sdk:test:integration:mainnet:  ❯ tests/integration-tests/sdk.mainnet.itest.ts:44:43
@polkadot-agent-kit/sdk:test:integration:mainnet:      42|
@polkadot-agent-kit/sdk:test:integration:mainnet:      43|         expect(swapCall).toBeDefined();
@polkadot-agent-kit/sdk:test:integration:mainnet:      44|         expect(swapCall.action.toolInput).toMatchObject({
@polkadot-agent-kit/sdk:test:integration:mainnet:        |                                           ^
@polkadot-agent-kit/sdk:test:integration:mainnet:      45|             amount: '0.1',
@polkadot-agent-kit/sdk:test:integration:mainnet:      46|             currencyFrom: 'DOT',
@polkadot-agent-kit/sdk:test:integration:mainnet:
@polkadot-agent-kit/sdk:test:integration:mainnet: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯

seems the mainnet test wasn't run for #109. but for w3f/Grant-Milestone-Delivery#1270, the test should also check observation content; this shouldn't pass the test:

@polkadot-agent-kit/sdk:test:integration:mainnet: stdout | tests/integration-tests/sdk.mainnet.itest.ts > PolkadotAgentKit Integration with OllamaAgent > should call swap_tokens tool for Polkadot to Polkadot Asset Hub swap
@polkadot-agent-kit/sdk:test:integration:mainnet: Swap Tokens Query Result (Polkadot → Polkadot Asset Hub): {
@polkadot-agent-kit/sdk:test:integration:mainnet:   input: 'swap 0.1 DOT from Polkadot to USDt on Polkadot Asset Hub',
@polkadot-agent-kit/sdk:test:integration:mainnet:   output: '<think>\n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     `Okay, the user tried to swap 0.1 DOT from Polkadot to USDt on Polkadot Asset Hub, but the swap failed. The error message says "Cannot read properties of undefined (reading 'otherAssets')". Hmm, that's a bit technical. Let me think about what could cause this.\n` +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '\n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     "First, maybe the swap_tokens function isn't the right tool here. The user mentioned transferring between chains, but the error suggests an issue with the function's parameters. Let me check the function's required parameters again. The swap_tokens function requires currencyFrom, currencyTo, amount, and optionally dex, from, and to. The user provided all necessary info: DOT to USDt, 0.1 amount, from Polkadot, to Polkadot Asset Hub.\n" +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '\n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     "Wait, the error mentions 'otherAssets', which might relate to the DEX's supported tokens. Maybe USDt isn't listed in the 'otherAssets' array for the DEX being used. The user didn't specify a DEX, so the function might be defaulting to a DEX that doesn't support USDt. Alternatively, the Polkadot Asset Hub might not have USDt available for swapping. \n" +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '\n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     `Another angle: the conversion from user input to the real param might be incorrect. The user said "Polkadot Asset Hub" which should map to "polkadot_asset_hub". But maybe the function expects a different format. Let me check the conversion table again. Yes, "Polkadot Asset Hub" converts to "polkadot_asset_hub". So that's correct.\n` +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '\n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     "Wait, the error is about 'otherAssets' being undefined. That suggests the function tried to access a property that doesn't exist. Maybe the DEX used by the function doesn't have USDt in its supported assets. Since the user didn't specify a DEX, perhaps the default DEX doesn't support USDt. Alternatively, the swap might require specifying a DEX that does support USDt, like a specific bridge or exchange.\n" +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '\n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     'So, the next step is to inform the user that the swap failed because USDt might not be supported on the target chain or via the default DEX. I should suggest checking if USDt is available on Polkadot Asset Hub and recommend using a specific DEX if possible. Also, maybe the user intended to use a different token or a different chain. Alternatively, the swap might need to go through a different route, like using a bridge or another DEX. I should ask the user to confirm the token availability and possibly specify a DEX if they know which one to use.\n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '</think>\n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '\n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     "The swap failed because the system couldn't find USDt in the supported assets for the cross-chain transfer. Here's what to do next:\n" +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '\n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '1. **Verify Token Availability**  \n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     "   Confirm if USDt is actually available on Polkadot Asset Hub. Some chains don't support certain tokens for cross-chain swaps.\n" +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '\n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '2. **Specify a DEX**  \n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '   Try using a specific DEX that supports USDt (e.g., HydrationDex or another bridge). Example:  \n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '   `swap 0.1 DOT from polkadot to USDt on polkadot_asset_hub via HydrationDex`\n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '\n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '3. **Alternative Token**  \n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     "   If USDt isn't supported, consider swapping to a native token first (e.g., DOT → KSM → USDt via a multi-hop route).\n" +
@polkadot-agent-kit/sdk:test:integration:mainnet:     '\n' +
@polkadot-agent-kit/sdk:test:integration:mainnet:     'Would you like to try one of these options?',
@polkadot-agent-kit/sdk:test:integration:mainnet:   intermediateSteps: [
@polkadot-agent-kit/sdk:test:integration:mainnet:     {
@polkadot-agent-kit/sdk:test:integration:mainnet:       action: [Object],
@polkadot-agent-kit/sdk:test:integration:mainnet:       observation: `{"content":"{\\"success\\":true,\\"data\\":\\"Cross-chain swap failed: 0.1 DOT to USDt from polkadot to polkadot_asset_hub. Error: Cannot read properties of undefined (reading 'otherAssets')\\",\\"tool\\":\\"swap_tokens\\",\\"timestamp\\":\\"2025-10-15T21:11:57.842Z\\"}","tool_call_id":"swap_tokens_1760562717842"}`
@polkadot-agent-kit/sdk:test:integration:mainnet:     }
@polkadot-agent-kit/sdk:test:integration:mainnet:   ]
@polkadot-agent-kit/sdk:test:integration:mainnet: }
@polkadot-agent-kit/sdk:test:integration:mainnet:
@polkadot-agent-kit/sdk:test:integration:mainnet:  ✓ tests/integration-tests/sdk.mainnet.itest.ts (1 test) 26958ms
@polkadot-agent-kit/sdk:test:integration:mainnet:    ✓ PolkadotAgentKit Integration with OllamaAgent > should call swap_tokens tool for Polkadot to Polkadot Asset Hub swap  15060ms
@polkadot-agent-kit/sdk:test:integration:mainnet:
@polkadot-agent-kit/sdk:test:integration:mainnet:  Test Files  1 passed (1)
@polkadot-agent-kit/sdk:test:integration:mainnet:       Tests  1 passed (1)
@polkadot-agent-kit/sdk:test:integration:mainnet:    Start at  23:11:36
@polkadot-agent-kit/sdk:test:integration:mainnet:    Duration  29.04s (transform 79ms, setup 0ms, collect 1.92s, tests 26.96s, environment 0ms, prepare 33ms)
@polkadot-agent-kit/sdk:test:integration:mainnet:
@polkadot-agent-kit/sdk:test:integration:mainnet:

 Tasks:    1 successful, 1 total
Cached:    0 cached, 1 total
  Time:    29.549s

@CocDap
Copy link
Collaborator

CocDap commented Oct 17, 2025

Thanks for the update. Since test cases such as the Hydration swap are part of Milestone 2, I was aware of this issue

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.

2 participants