Fix fallback safety, strict error diagnostics, and metadata command cache bypass#3
Merged
ggonzalez94 merged 3 commits intomainfrom Feb 22, 2026
Merged
Fix fallback safety, strict error diagnostics, and metadata command cache bypass#3ggonzalez94 merged 3 commits intomainfrom
ggonzalez94 merged 3 commits intomainfrom
Conversation
Owner
Author
|
@codex please review |
|
Codex Review: Didn't find any major issues. Keep it up! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Owner
Author
|
@cursor please review |
|
Here’s my review:
if !shouldFallback(err) {
return nil, statuses, warnings, false, err
}
if !assetHasResolvedSymbol(asset) {
warnings = append(warnings, "fallback skipped: asset symbol could not be resolved from input")
return nil, statuses, warnings, false, err
}if !assetHasResolvedSymbol(req.Asset) {
filteredProviders := make([]string, 0, len(selectedProviders))
skippedDefiLlama := false
for _, providerName := range selectedProviders {
if providerName == "defillama" {
skippedDefiLlama = true
continue
}
filteredProviders = append(filteredProviders, providerName)
}
if skippedDefiLlama {
warnings = append(warnings, "provider defillama skipped: unresolved asset symbol cannot be matched safely")
}
selectedProviders = filteredProviders
if len(selectedProviders) == 0 {
return nil, nil, warnings, false, clierr.New(clierr.CodeUsage, "selected providers require a resolvable asset symbol")
}
}func matchesAssetSymbol(symbolRaw string, expected string) bool {
if strings.TrimSpace(expected) == "" {
return false
}
symbolRaw = strings.ToUpper(strings.TrimSpace(symbolRaw))
expected = strings.ToUpper(strings.TrimSpace(expected))
func shouldOpenCache(commandPath string) bool {
switch normalizeCommandPath(commandPath) {
case "", "version", "schema", "providers", "providers list":
return false
default:
return true
}
}
env := model.Envelope{
Version: model.EnvelopeVersion,
Success: false,
Data: []any{},
Error: &model.ErrorBody{ Code: code, Type: typ, Message: message },
Warnings: warnings,
Meta: model.EnvelopeMeta{
RequestID: newRequestID(),
Timestamp: s.runner.now().UTC(),
Command: commandPath,
Providers: providers,
Cache: cacheMetaBypass(),
Partial: partial,
},
}Suggestions (non-blocking):
Overall: Changes implement the stated goals, behavior is covered by tests (with the small gap noted), and docs/changelog are aligned. Approved. |
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
This PR addresses the top three reliability issues identified in the DeFi CLI deep-dive review:
Changes
version,schema, andproviders listnow bypass cache openexit 15) error envelopes now include provider statuses, warnings, andmeta.partial=trueREADME.md,AGENTS.md, andCHANGELOG.mdValidation
go test ./...go test -race ./...go vet ./..../defi providers list --results-only./defi lend markets --protocol aave --chain 1 --asset USDC --results-only./defi yield opportunities --chain 1 --asset USDC --providers aave,morpho --limit 5 --results-only