fix: resolve open issues #8, #9, #10, #11, #12, #13#14
Merged
Conversation
- #8: Check Claude Code availability before spawning in `create` command - #9: Add compatibility shim for both `create_protocol()` and `Protocol(spec=...)` in all 7 templates - #10: Add `--template` flag as alias for `--type` in scaffold command - #11: Document all AgentLaunchError properties (code, details, retryAfterMs) in SDK README - #12: Add missing 7 tools to MCP README, update count to 21 - #13: Check token graduation status in get_trade_link — return DEX link for listed tokens - Fix broken genesis template import in registry after PR #6 cleanup Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Mar 6, 2026
Comment on lines
+221
to
+224
| const dexBaseUrl = token.chainId === 56 | ||
| ? 'https://pancakeswap.finance/swap' | ||
| : 'https://pancakeswap.finance/swap'; | ||
| const dexLink = `${dexBaseUrl}?outputCurrency=${args.address}`; |
There was a problem hiding this comment.
Bug: The ternary operator in getTradeLink assigns the same PancakeSwap URL regardless of the token.chainId, generating incorrect DEX links for non-BSC chains like Ethereum.
Severity: HIGH
Suggested Fix
Update the ternary operator to return the correct DEX base URL based on the token.chainId. For example, for Ethereum chains (like chainId 1), it should point to a suitable DEX like Uniswap, while continuing to use PancakeSwap for BSC chains (chainId 56).
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: packages/mcp/src/tools/handoff.ts#L221-L224
Potential issue: In the `getTradeLink` function, the `dexBaseUrl` is determined by a
ternary operator that checks `token.chainId`. However, both the `true` and `false`
branches of the operator return the same PancakeSwap URL. The system supports non-BSC
chains like Ethereum (chainId 1) and Sepolia (chainId 11155111), where PancakeSwap is
not the correct DEX. As a result, if a token on an Ethereum-based chain graduates to a
DEX listing, this function will generate an incorrect trade link pointing to
PancakeSwap, breaking the functionality for users and leading them to the wrong
exchange.
Did we get this right? 👍 / 👎 to inform future reviews.
This was referenced Mar 6, 2026
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 all 6 open bug/enhancement issues:
agentlaunch create#8 CLI prompts for Claude Code login: Added availability check before spawningclaude— gracefully handles missing/uninstalled Claude Codecreate_protocolmethod #9 Agent fails to start (missingcreate_protocol): Added compatibility shim in all 7 templates to support bothcreate_protocol()(new API) andProtocol(spec=chat_protocol_spec)(legacy API)buy/sellcommands andscaffold --templateoption #10 CLI missing--templateflag: Added--templateas alias for--typein scaffold command. Buy/sell commands already exist and are registered.AgentLaunchErrorproperties (code,details,retryAfterMs) with usage examplebuy_tokensgenerates bonding curve link for graduated tokens #13 MCPbuy_tokensgenerates wrong link for graduated tokens:get_trade_linknow checks token'slistedstatus and returns PancakeSwap DEX link for graduated tokensAlso fixes broken genesis template import in registry (leftover from PR #6 cleanup).
Test plan
npm run buildpasses (all 4 packages compile)agentlaunch scaffold my-agent --template researchworksagentlaunch creategracefully handles missing Claude Codeget_trade_linkreturns DEX link for graduated tokensCloses #8, #9, #10, #11, #12, #13
🤖 Generated with Claude Code