Repository navigation
Use /session for status account info, fall back to /v3/session on older servers - #117
Conversation
|
Requesting a change in Please preserve enough response information to fall back only for the explicit compatibility condition (normally 404; account for the scoped-key legacy 403 behavior described on supermemory#1839 if this client supports scoped keys). Add tests for canonical success, compatibility fallback, and a representative non-fallback failure. |
|
P2 — Fall back only when
|
Merge activity
|
…er servers (#117) ## What The Supermemory API now serves the session endpoint unversioned at `/session` and keeps `/v3/session` as a deprecated alias (supermemoryai/mono#3626). `status` now looks up account info via `/session` first and falls back to `/v3/session` when the server predates it. - `src/cli.ts`: `getAccountInfo` tries `/session`, then `/v3/session`. ## Compatibility - Older plugin builds keep working: the API still serves `/v3/session`. - This build works against older self-hosted servers: `/session` 404s there, `fetchJson` returns null, and `/v3/session` is used. One extra request on old servers only. Note: the repo's v5 migration chose explicit `apiVersion` selection "without failed-request fallback". This PR uses a fallback for this one read-only call; happy to switch it to the `apiVersion` gate if preferred. ## Verification - `bun run typecheck`, `bun test` (33/33). - `bun src/cli.ts status` against a local API on the new path and against a shim that 404s `/session`: account details resolve in both; the shim log shows `404 GET /session` then `GET /v3/session`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
6a6d5b3 to
26e247e
Compare
What
The Supermemory API now serves the session endpoint unversioned at
/sessionand keeps/v3/sessionas a deprecated alias (supermemoryai/mono#3626).statusnow looks up account info via/sessionfirst and falls back to/v3/sessionwhen the server predates it.src/cli.ts:getAccountInfotries/session, then/v3/session.Compatibility
/v3/session./session404s there,fetchJsonreturns null, and/v3/sessionis used. One extra request on old servers only.Note: the repo's v5 migration chose explicit
apiVersionselection "without failed-request fallback". This PR uses a fallback for this one read-only call; happy to switch it to theapiVersiongate if preferred.Verification
bun run typecheck,bun test(33/33).bun src/cli.ts statusagainst a local API on the new path and against a shim that 404s/session: account details resolve in both; the shim log shows404 GET /sessionthenGET /v3/session.🤖 Generated with Claude Code