fix(gateway): point all 18 tools + 2 resources at api.wave.online/v1/*, not the 404ing marketing site - #92
fix(gateway): point all 18 tools + 2 resources at api.wave.online/v1/*, not the 404ing marketing site#92yakimoto wants to merge 5 commits into
Conversation
…e 404ing marketing site (#91) Every tool/resource built requests as `${WAVE_BASE_URL}/api/v1/...` against a default WAVE_BASE_URL of https://wave.online (the marketing/docs Next.js site). Neither wave.online nor api.wave.online serve /api/v1/* — that prefix is wave-gateway internal forwarding shape to the WSC origin (forward.ts ORIGIN_PATH_PREFIX), never a path a client should call directly. Every customer using the published package got a prerendered Next.js 404 on every tool call. wave-gateway PR #835 proved, with zero credentials and receipts in the PR body, that the gateway-public equivalents at /v1/* against https://api.wave.online are live and scope-gated: 18/18 routes answered 402 PAYMENT_REQUIRED. Fixed this package to build exactly that shape: - src/auth.ts: DEFAULT_BASE_URL -> https://api.wave.online - src/tools/*.ts, src/resources/*.ts: /api/v1/* -> /v1/* - README.md: corrected the documented WAVE_BASE_URL default Adds a regression test suite (no test runner previously existed in this repo - added tsx + a node:test script) that mocks the HTTP layer and proves every one of the 18 tools and both wave:// resources now calls https://api.wave.online/v1/*, and never /api/v1/*. Verified the test suite actually catches the bug by running it against a scratch copy with the old paths restored (18/18 + base-url assertions fail there; all pass on this fix). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_8f0d941e-178f-4948-9a17-ff7d9b3b1984) |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 18 minutes Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (18)
Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
PR Summary by Qodofix(gateway): use api.wave.online/v1 for all tools/resources (fix #91)
AI Description
Diagram
High-Level Assessment
Files changed (15)
|
There was a problem hiding this comment.
Risk: medium. Left a non-blocking comment — Cursor Bugbot and Cursor Security Agent both finished as skipped (Bugbot hit a usage limit), so required automated review signals are incomplete and this is not approved. Human review is needed; no eligible non-author reviewers were assignable from CODEOWNERS or recent editors.
Sent by Cursor Approval Agent: Pull Request Router and Approver
…ontent policy Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
…ave.online defaults in docs/SSOT Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
Code Review by Qodo
1.
|
Qodo FixerNo findings are within the configured fix scope. To change which findings are fixed, adjust the setting on your Qodo configuration page. |
…ncy graph Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
| */ | ||
|
|
||
| const DEFAULT_BASE_URL = "https://wave.online"; | ||
| const DEFAULT_BASE_URL = "https://api.wave.online"; |
There was a problem hiding this comment.
🔍 Behavior change for users who override WAVE_BASE_URL
Anyone who already pointed WAVE_BASE_URL at a self-hosted or staging origin that serves /api/v1/* will now get 404s, since every path lost the /api segment while the override mechanism is unchanged (src/auth.ts:23-25). MCP-DEBUGGING.md:82 still advertises https://staging.wave.online — worth confirming that origin serves the public /v1/* shape, otherwise staging users trade one 404 for another.
Was this helpful? React with 👍 or 👎 to provide feedback.
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>


What
Fixes #91: every one of this package's 18 tools (plus both
wave://resources) built requests as${WAVE_BASE_URL}/api/v1/...against a defaultWAVE_BASE_URLofhttps://wave.online— the marketing/docs Next.js site. Neitherwave.onlinenorapi.wave.onlineserve/api/v1/*: per wave-gateway'sforward.ts:262(ORIGIN_PATH_PREFIX), that prefix is the gateway's internal forwarding shape to the WSC origin, never a path a client should call directly. Every customer using the published package (currently0.2.0on npm) got a prerendered Next.js 404 on every tool call — a live prod defect, not hypothetical.Root cause, confirmed against wave-gateway
wave-gateway PR #835 (same session, filed the finding as issue #91 here) independently probed all 18 routes with zero credentials and receipts in the PR body:
So this is not a "never wired up" bug — the backend routes are real, live, and correctly gated at the gateway-public
/v1/*shape. This package was simply pointed at the wrong origin and the wrong (internal) path prefix.Fix
src/auth.ts:DEFAULT_BASE_URL→https://api.wave.online(washttps://wave.online)src/tools/*.ts,src/resources/*.ts:/api/v1/*→/v1/*(18 call sites acrossstreams.ts,studio.ts,analytics.ts,billing.ts,production.ts, plus bothresources/*.ts)README.md: corrected the documentedWAVE_BASE_URLdefaultCHANGELOG.md:UnreleasedentryWAVE_BASE_URLenv override still works unchanged for anyone pointed at a non-default environment (staging, etc).Tests
This repo had no test runner at all. Added
tsx(pinned, devDependency) + atestnpm script (node --import tsx --test), and three test files:src/auth.test.ts— unit tests forgetBaseUrl()'s default +WAVE_BASE_URLoverride,getApiKey()'s error messagesrc/tools/regression-91.test.ts— mocks the HTTP layer, invokes all 18 tool handlers with minimal valid args, asserts every one callshttps://api.wave.online/v1/*and never/api/v1/*src/resources/regression-91.test.ts— same proof for the twowave://resourcesVerified the tests actually catch the bug, not just pass trivially: ran the same test files against a scratch copy with the old
/api/v1/*paths andwave.onlinedefault restored — 18/18 tool subtests plus the base-URL assertion failed there, confirming the test is a real regression guard, not a tautology. All pass against this fix (23/23).Not in scope (flagged, not fixed here)
capabilities.jsonsays"version": "0.1.5"vspackage.json's0.2.0(noted as a follow-up in wave-gateway#835, doc-drift only, unrelated to this bug)src/tools/shared.ts'sUser-Agent: wave-mcp-server/0.1.0string is stale too, but not part of this defectNote on the "never wired up" branch of this investigation
The task that produced this PR explicitly considered the alternative root cause — that these 18 tools' backend routes might never have existed in wave-gateway at all (package shipped ahead of backend). Ruled out: wave-gateway PR #835's redteam probe proves all 18 gateway-public
/v1/*routes are live and scope-gated today. This is a wrong-URL bug in this package, fully fixable here, not a cross-repo/product decision.🤖 Generated with Claude Code
Note
Cursor Bugbot is generating a summary for commit 0a51952. Configure here.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is enabled.Note
Fix all 18 tools and 2 resources to call
api.wave.online/v1/*instead of the marketing siteDEFAULT_BASE_URLin auth.ts fromhttps://wave.onlinetohttps://api.wave.online, fixing 404s across all handlers./apiprefix from every hardcoded path across all tool and resource handlers so requests target/v1/*instead of/api/v1/*.https://api.wave.online/v1/*.https://wave.onlinedefault or/api/v1/*paths must updateWAVE_BASE_URLif it was overriding to the correct host — all requests now go toapi.wave.online/v1/*by default.Macroscope summarized 0a51952.