fix: recognize spot-only tokens in IsToken

Gate token detection via spot symbol resolution so chat flow accepts spot-only tokens, and add regression coverage for the fallback path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 03:59:32 +07:00
parent 72bbe66c3e
commit 0705e909dc
2 changed files with 9 additions and 3 deletions
@@ -137,6 +137,14 @@ func TestIsToken(t *testing.T) {
},
want: true,
},
{
name: "spot only token fallback",
input: "abc",
marketStub: &resolverMarketStub{
spotPairs: map[string]bool{"ABCUSDT": true},
},
want: true,
},
{
name: "non alphanumeric input",
input: "bad!",