fix(api): target api.wave.online/v1/* — the host AND path that serve the API (#89) - #90
fix(api): target api.wave.online/v1/* — the host AND path that serve the API (#89)#90yakimoto wants to merge 4 commits into
Conversation
…the API (#89) The default WAVE_BASE_URL was https://wave.online (the marketing/app origin, which 404s on the API surface) and every tool requested /api/v1/*. Both were wrong and they compounded: with default configuration none of the 18 tools could ever succeed. /api/v1/* was never a valid CLIENT path. The WAVE gateway serves /v1/* publicly and re-prefixes to the spoke origin as /api/v1/* on forward (wave-gateway forward.ts ORIGIN_PATH_PREFIX), so fixing only the host — as the issue proposed — would still have 404d on every call. Measured 2026-08-07: POST api.wave.online/v1/streams -> 402 (route exists, priced) POST api.wave.online/api/v1/streams -> 404 POST wave.online/api/v1/streams -> 404 Also: validate an explicitly-set WAVE_BASE_URL (fail loud at startup on a malformed or non-http(s) value instead of failing opaquely inside each tool call), and repoint the key-minting URL at console.wave.online/dashboard#keys (the old one 404d). Docs corrected against live probes: the staging origin the debugging guide advertised (staging.wave.online) has no DNS record and never resolved; the tool count said 19 when there are 18. Installed copies stay broken until this is released to npm. Co-Authored-By: Claude Fable 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_917fdd09-4ea8-4100-9631-c699c77f324e) |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 33 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 selected for processing (14)
Comment |
There was a problem hiding this comment.
Risk: medium. Left a non-blocking comment — Cursor Bugbot and Cursor Security Agent both completed as skipped (Bugbot hit a usage limit), so automated review signals are incomplete and this is not approved. Human review is needed; no additional reviewers could be assigned (CODEOWNERS team is unavailable and the only active human contributor is the PR author).
Sent by Cursor Approval Agent: Pull Request Router and Approver
PR Summary by QodoFix default Wave API origin and switch client paths to /v1 gateway routes
AI Description
Diagram
High-Level Assessment
Files changed (11)
|
ApprovabilityVerdict: Approved 1ca8943 Bug fix correcting broken API URLs (wrong host and paths caused all 18 tools to 404). Changes are mechanical URL/path string updates plus defensive startup validation. Author owns all modified files. The unresolved review comment appears outdated - the diff shows assertConfigValid() is added to both server entry points. You can customize Macroscope's approvability policy. Learn more. |
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. |
…ce (#89) The public-repo-guard content policy blocked the previous commit: the explanatory comment in src/auth.ts named a private WAVE repo and one of its internal source files. That is exactly what the guard exists to catch, and it was right to. The comment now explains the same thing — why the API origin is api.wave.online and why the tool paths are /v1/* rather than /api/v1/* — without naming any private repo or internal module. The measured probe table is unchanged; it was never the problem. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tps (#89 review) Four review findings, all correct: 1. The validation was lazy. getBaseUrl() is only reached when a tool runs, so a bad value still failed once per tool call — exactly what the change claimed to remove. startServer() now calls assertConfigValid() before binding the transport. 2. A value with surrounding whitespace, or a path/query/fragment, produced broken request URLs. The URL parser tolerates whitespace that string concatenation does not, and tool paths (/v1/...) are appended to this value. It now returns parsed.origin, and REJECTS a path/query/fragment rather than silently dropping it. 3. http:// to a remote host sent the API key in cleartext (every request attaches Authorization: Bearer). Now refused unless the host is loopback. 4. README is machine-generated from .wave/repo.json, which still carried the old default and the dead key-minting URL — the next regeneration would have reverted the README fix. The SSOT is updated too. Also repairs the CHANGELOG: the previous commit inserted a "### Changed" heading mid-list, which orphaned the existing .d.ts entry under it and produced two identical headings in one release block. Verified at startup against the built artifact: "https://api.wave.online/" -> starts (trailing slash normalised) " https://api.wave.online " -> starts (whitespace trimmed) "http://localhost:8787" -> starts (loopback allowed) "http://api.wave.online" -> Fatal: must use https for a remote host "https://api.wave.online/v1" -> Fatal: must be an origin only "not-a-url" -> Fatal: not a valid absolute URL Co-Authored-By: Claude Fable 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_8a979a98-ae4f-423c-95fe-d10bd53fad7a) |
Review responses — addressed in
|
…oo (#89 review) assertConfigValid() was wired into startServer() only, which is the stdio entry point. Consumers using createWaveSdkMcpServer() never reached it, so the documented "validated at startup" contract held for one of the two transports — and in-process consumers kept seeing a malformed WAVE_BASE_URL surface once per tool call, which is the behaviour the doc comment claims was removed. Both transports now validate at construction. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Addressed in
|


Closes #89.
The issue was right that it's broken, and incomplete about why
#89 proposed changing the default
WAVE_BASE_URLfromhttps://wave.onlinetohttps://api.wave.online. That alone would not have fixed a single tool, because every toolalso hardcodes
/api/v1/*, and/api/v1/*is not a client path on any WAVE host./v1/*is the public API path space onapi.wave.online./api/v1/*is an internal path shape thatis not routable by a client on any host — confirmed against the API's own routing layer — so fixing only
the host, as the issue proposed, would still have 404'd on every call.
Measured live, 2026-08-07:
POST https://api.wave.online/v1/streamsPOST https://api.wave.online/api/v1/streamsPOST https://wave.online/api/v1/streamsGET https://api.wave.online/v1/nonexistentgroupxyzROUTE_NOT_MAPPED(fail-closed control)All 12 distinct
/v1paths the 18 tools use were probed individually; every one returns 402, i.e.every one is a real, priced, scope-gated API route.
What changed
src/auth.ts—DEFAULT_BASE_URL→https://api.wave.online.src/tools/*.ts,src/resources/*.ts) —/api/v1/*→/v1/*.WAVE_BASE_URLvalidation. An explicitly-set value is now parsed and required to be anabsolute http(s) URL, with the trailing slash stripped (tool paths are absolute, so a trailing
slash produced
//v1/...). A bad value used to surface as an opaque fetch failure inside everyindividual tool call; it now fails at startup naming the offending value. The default is kept
rather than made mandatory — there is a correct, measured answer, so requiring every user to
supply it would be friction with no safety gain.
https://console.wave.online/dashboard#keys(307 →/login?redirect=…,i.e. a real page). The old
https://wave.online/settings/api-keysreturned 404, so the onlypointer a user got toward credentials was dead.
Docs corrected against live probes, not assumed
MCP-DEBUGGING.mdadvertised a staging origin,https://staging.wave.online. It has no DNSrecord (
dig +short staging.wave.online→ empty) and never resolved. The table has been removedrather than reworded — I did not invent a replacement staging host.
unscoped/unpaid call and reads like a failure if you don't know that.
Receipts
Built bundle (
npm run build):End-to-end, driving the built stdio server over real JSON-RPC with a junk API key
(
tools/call→wave_list_streams):Before this change the same call produced a 404 from a host that does not serve the API. The 402 is
the receipt: the API answered, the route resolved, and it is priced.
npm run type-check,npm run lint --max-warnings 0, andnpm run buildall pass. This repo hasno test suite (no
*.test.ts/*.spec.ts, no test runner inpackage.json), so there is nobefore/after suite count to report — that gap is worth its own issue.
Not done here — needs a release
This package is published to npm. A merge does not remediate installed copies. Every existing
install stays broken until a
v*tag is pushed and the release workflow republishes. I did not bumppackage.json(the release workflow requires tag version == package version, so the bump is part ofthe release act, not this fix) and I did not tag — that is a publish crossing.
Given the default host changes and every request path changes, this warrants a minor bump
(0.2.0 → 0.3.0) and a note in the release announcement that prior versions were non-functional.
🤖 Generated with Claude Code
Note
Fix default API origin and tool path prefix to target
api.wave.online/v1/*DEFAULT_BASE_URLin auth.ts from the marketing/app origin to the gateway origin (api.wave.online), fixing systematic 404s whenWAVE_BASE_URLis unset./apiprefix from all tool and resource fetch paths (e.g./api/v1/streams→/v1/streams) across all tool and resource files to match the gateway's public path space.assertConfigValid()called at startup in both server.ts and sdk-server.ts to fail fast with a clear error on a malformedWAVE_BASE_URL.getBaseUrl()to reject non-absolute URLs,httpfor non-loopback hosts, and any URL with a path, query, or fragment.Macroscope summarized 1ca8943.
Note
High Risk
Touches every outbound API call and the default configuration path; incorrect rollout would break all 18 tools for npm consumers until they upgrade, though the change aligns endpoints with the live gateway.
Overview
Fixes #89: with the previous defaults (
https://wave.online+/api/v1/*), none of the 18 tools could reach a real API route. The default origin is nowhttps://api.wave.online, and every tool andwave://resource fetch uses/v1/*instead of/api/v1/*.WAVE_BASE_URLis validated when the stdio server starts (assertConfigValidinstartServer): values must be a bare http(s) origin (no path/query/hash), remote hosts must use https (loopbackhttpstill allowed), and bad config fails once at startup instead of on every tool call. Missing-key errors point toconsole.wave.online/dashboard#keysinstead of a 404 settings URL.Docs (
README,.wave/repo.json,MCP-DEBUGGING.md,CHANGELOG) match the new default, tool count (18), removed bogus staging host, and add 402 troubleshooting.Reviewed by Cursor Bugbot for commit 938ce20. Configure here.