Skip to content

[FIX] sync surf API spec from configured base#27

Merged
HappySean2845 merged 3 commits into
asksurf-ai:mainfrom
ZhimaoL:fix/surf-sync-base-url
Jun 12, 2026
Merged

[FIX] sync surf API spec from configured base#27
HappySean2845 merged 3 commits into
asksurf-ai:mainfrom
ZhimaoL:fix/surf-sync-base-url

Conversation

@ZhimaoL

@ZhimaoL ZhimaoL commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make SURF_API_BASE_URL / --surf-api-base-url apply to surf sync and lazy auto-sync, not only operation requests
  • stamp cached API specs with the configured API base and treat mismatched-base cache as a miss
  • fix command detection when global flags with values appear before the command
  • add regression tests for env-specific sync, configured-base sync, and prod/stg cache isolation

Why

STG runners can set SURF_API_BASE_URL=https://api.stg.ask.surf/gateway/v1, but current surf sync and cache-miss lazy sync still load the prod gateway spec. That can make STG agents use prod OpenAPI cache, miss STG-only endpoints, and add cache-miss sync latency/noise to eval runs.

Test plan

  • go test ./...
  • built a local binary and verified real STG sync:
    • SURF_API_BASE_URL=https://api.stg.ask.surf/gateway/v1 surf sync
    • surf list-operations shows hyperliquid-account, hyperliquid-fills, hyperliquid-leaderboard, hyperliquid-positions, hyperliquid-trader-stats
  • verified config.json records surf.base=https://api.stg.ask.surf/gateway

@HappySean2845
HappySean2845 merged commit f47d10b into asksurf-ai:main Jun 12, 2026
3 checks passed
@ZhimaoL ZhimaoL mentioned this pull request Jun 24, 2026
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.

2 participants