Send X-Arkor-Client during anonymous token bootstrap#43
Merged
soleil-colza merged 1 commit intomainfrom Apr 28, 2026
Merged
Conversation
- Added tests for requestAnonymousToken to ensure correct behavior. - Included X-Arkor-Client header in the request to the cloud API. - Enhanced error handling for non-2xx responses.
Contributor
There was a problem hiding this comment.
k-taro56 has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
soleil-colza
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
requestAnonymousTokenwas the one SDK call path that issued a rawfetchinstead of going through
createClient(...), so it never set theX-Arkor-Client: arkor/<version>header. The cloud API's SDK version gaterejects header-less requests with
426 sdk_version_unsupported(
reason: "missing") — even whileSUPPORTED_RANGEis*, by design, sothat pre-header SDK builds can't silently bypass policy during rollout.
End-to-end effect: on a fresh install with no
~/.arkor/credentials.json,arkor devfails to bootstrap an anonymous identity and exits with:This blocks the
npm create arkor→arkor devhappy path on everymachine that hasn't been onboarded yet.
Changes
packages/arkor/src/core/credentials.ts: addX-Arkor-Client: arkor/${SDK_VERSION}to the bootstrap fetch.packages/arkor/src/core/credentials.test.ts: newrequestAnonymousTokendescribe block covering (a) the header is present on the wire, (b) the
response shape is mapped correctly, (c) non-2xx surfaces the status.
Test plan
pnpm --filter arkor test— green (12 files / 93 tests)pnpm typecheck— clean workspace-wide~/.arkor/credentials.json, runarkor devagainst adeployment with the gate enabled, confirm anonymous bootstrap completes
and Studio reaches
/api/credentials.Follow-up
arkoralpha so users unblocked by this fix canpnpm add arkor@alpha./v1/*request in thispackage is built without going through
createClient(would have caughtthis at PR time).