rkd: check the server API version before signing in #7
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The RKD server now reports its API contract version on
GET /api/healthas{"status":"ok","api_version":N}. A server from before the contract answers a bareOK, which counts as version 0. The app declares the lowest version it needs, refuses store builds against an older server, and shows a "server needs an update" screen instead of failing request by request.The plugin has the same exposure and no check. It is installed from the marketplace, not auto-updated, and the server it talks to (
prod,devor any address) can be older than it. It depends on/api/app-hosts/*, which older servers don't have, so today it fails with 404s on device sign-in and gives no reason.Proposal: at startup (and in the
statustool), GET<server>/api/healthwith no auth, parse it the same way the app does (bareOK= 0, JSONapi_versioninteger, anything else = unknown), and compare against aMIN_SERVER_API_VERSIONconstant (1 today). Below the minimum: say so on stderr, in the instructions and instatus("this RKD server is older than the plugin needs; update the server or point the plugin at another one") and skip device sign-in. Unknown or unreachable: warn, don't block — same ascheckClientVersiondoes for the Claude Code version.Tests: bare
OK, below, at and above the minimum, unknown body, network error. When the server later bumpsAPI_VERSIONfor something the plugin uses, raise the plugin's minimum in the same release.