Merge main into stg for exchange e2e#37
Closed
ZhimaoL wants to merge 10 commits into
Closed
Conversation
Without a cached OpenAPI spec, every API command fails — either with "unknown command: polymarket-markets" (commands not registered) or "no cached API spec — run surf sync first" (list-operations). Agents hit this ~17 times in recent eval runs when they skipped the initial surf sync step the SKILL.md asks for. Do the sync ourselves on cache miss, deterministically: - Before registering API commands, detect cache-miss + API-style argv - Silently fetch the spec (one stderr line: "No cached API spec, syncing...") - Proceed with normal command registration and dispatch - On fetch failure, fall through — existing error paths still produce a specific message with context for the user's actual command Meta commands (auth, sync, version, install, help, etc.) skip the auto-sync path — they don't need the spec. list-operations DOES need it and triggers auto-sync. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
install.sh targets ~/.local/bin (see installDir() in cmd/surf/install.go and install_test.go:11-19), not ~/.surf/bin. The old path was wrong in both the Install section (L13) and the Local development symlink example added in asksurf-ai#14 (L83, L88) — following the latter silently shadowed nothing because ~/.surf/bin didn't exist. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ai#23) For string params with an OpenAPI enum, the --help column used to show the first back-quoted word from the description (e.g. `--metric tier` when the spec had `tier` in Markdown backticks), which agents read as "default = tier" and skipped the flag. Root cause: spec descriptions legitimately use Markdown backticks to emphasize enum values, but pflag's UnquoteUsage interprets the first back-quoted word as the flag's type placeholder. Two conventions collide on the same character. This change: - Strips backticks from descriptions in openapi.go so pflag can't hoist an enum value into the placeholder column. - Adds Param.Enum and a custom pflag Value whose Type() returns "{a|b|c}" so the placeholder column shows the full choice list. - Falls back to plain "string" when the joined placeholder would exceed 40 chars and break column alignment. Before: --metric tier Ranking metric. Can be tier (...) or `portfolio_count` (...). (required) After: --metric {tier|portfolio_count} Ranking metric. Can be tier (...) or portfolio_count (...). (required) Other commands now show clearer enum columns, e.g. --interval {5m|1h|1d|7d} --order {asc|desc} --sort-by {market_cap|change_24h|volume_24h} Refs docs/issues.md asksurf-ai#3. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`surf market-futures --symbol BTC` no longer works — `market-futures` became a ranking-style snapshot endpoint that explicitly does not accept `--symbol`. Swap to `surf market-price --symbol BTC`, which is the canonical symbol-keyed time-series query and returns real data. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sksurf.ai (asksurf-ai#25) The Surf docs are served from agents.asksurf.ai (Next.js, surf-landing repo); docs.asksurf.ai is a stale Mintlify mirror that is no longer the canonical source. Update the root --help footer URL and the test assertion that pins it. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…cing (asksurf-ai#28) Cache.WriteConfig() errors were swallowed, so a failed expiry write made every subsequent invocation treat the spec cache as missing and re-sync ('No cached API spec, syncing...' on each call). Log the failure reason to stderr, and include the file path in the cbor cache write error. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* [FIX] sync surf API spec from configured base * fix(tests): build surf binary with windows extension * fix(cli): keep surf cache tests hermetic --------- Co-authored-by: HappySean <zhaoxiang2845@gmail.com>
# Conflicts: # cmd/surf/main.go # cmd/surf/main_test.go
Contributor
Author
|
Closing this PR because it merged origin/main into stg and pulled unrelated historical main/stg drift into the diff. I will replace it with a minimal cherry-pick PR containing only the configured base URL sync fix needed for staging exchange e2e. |
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
Verification