Fix: Proposal: add quote display sanity checks for Base MCP agent#142
Open
joebkarwalo wants to merge 1 commit into
Open
Fix: Proposal: add quote display sanity checks for Base MCP agent#142joebkarwalo wants to merge 1 commit into
joebkarwalo wants to merge 1 commit into
Conversation
Collaborator
🟡 Heimdall Review Status
|
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.
What
Adds a new skill reference file (
skills/base-mcp/references/quote-sanity.md) that gives agents an explicit function/formula for converting a raw token amount (wei / smallest unit) into a human-readable value using the token'sdecimals, plus a checklist to sanity-check that conversion before showing a quote or requesting approval. Cross-references this new file fromapproval-mode.md's "Common mistakes" section so agents load it as part of the approval flow.Why
As reported in the issue, an agent displayed
50,355,726,366,371wei as0.050356 ETHinstead of the correct0.000050355726366371 ETHin a pre-approval chat summary. Even though the Base Account approval screen itself was correct, an incorrect human-readable summary before approval undermines user trust and could cause a user to misunderstand what they're about to approve. This adds an explicit, reusable conversion function and verification checklist so agents compute (and can self-check) the human-readable amount correctly instead of eyeballing/misformatting it.Testing
Manually verified the worked example in the new reference file matches the issue's numbers exactly:
50355726366371wei, decimals:18(ETH)50355726366371 / 10^18 = 0.000050355726366371 ETH— matches the issue's stated "correct human-readable value".approval-mode.md.Closes #68