fix: reject unknown token symbols with error instead of allowing continuation (Vibe Kanban)#8
Merged
MinaraAgent merged 3 commits intomainfrom Apr 3, 2026
Merged
Conversation
…inuation Modify lookupToken() to throw an error when a token cannot be resolved, preventing invalid tokens from reaching the confirmation step in swap, transfer, withdraw, and limit-order commands. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ers an unknown/fictional token symbol, the CLI throws an error immediately during token lookup, rather than allowing the invalid token to proceed to the confirmation step.
There was a problem hiding this comment.
Code Review
This pull request updates project dependencies and modifies the lookupToken utility in src/utils.ts to throw errors instead of returning partial data when a token cannot be found. Review feedback suggests refining the error handling to distinguish between API failures and missing tokens for better user clarity. Additionally, the catch block should be updated to avoid masking prompt cancellations or other system errors as 'Unknown token' issues, which currently interferes with the CLI's ability to exit gracefully.
- Distinguish API failures from unknown tokens in error messages - Re-throw all errors to preserve prompt cancellation handling - Allow wrapAction to properly handle Ctrl+C during token selection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
lookupToken()insrc/utils.tsto throw anUnknown tokenerror when a token cannot be resolved, instead of returning the raw input and allowing the flow to continue{ address: tokenInput }for unknown tokensChanges Made
src/utils.ts- Modified thelookupToken()function:{ address: tokenInput }, allowing invalid tokens to proceed through the flowError("Unknown token: ${tokenInput}")immediately when token lookup fails, preventing invalid tokens from reaching the confirmation stepWhy This Matters
Previously, when a user entered a fictional/unknown token symbol like
$FAKETOKEN, the CLI would:Now, the CLI:
wrapAction()and displayed cleanly to the userThis affects all commands that use
lookupToken():swaptransferwithdrawlimit-orderTesting
tsc --noEmit)✖ Unknown token: $FAKETOKENThis PR was written using Vibe Kanban