Skip to content

fix: resolve open issues #8, #9, #10, #11, #12, #13#14

Merged
Hovessian merged 1 commit intomainfrom
fix/resolve-open-issues
Mar 6, 2026
Merged

fix: resolve open issues #8, #9, #10, #11, #12, #13#14
Hovessian merged 1 commit intomainfrom
fix/resolve-open-issues

Conversation

@Hovessian
Copy link
Copy Markdown
Collaborator

Summary

Fixes all 6 open bug/enhancement issues:

Also fixes broken genesis template import in registry (leftover from PR #6 cleanup).

Test plan

  • npm run build passes (all 4 packages compile)
  • Verify agentlaunch scaffold my-agent --template research works
  • Verify agentlaunch create gracefully handles missing Claude Code
  • Verify MCP get_trade_link returns DEX link for graduated tokens

Closes #8, #9, #10, #11, #12, #13

🤖 Generated with Claude Code

- #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>
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}`;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

CLI prompts for Claude Code login during agentlaunch create

1 participant