fix(mobile): route create_session ids through the SDK runtime shim - #5145
Merged
Conversation
`/new` in a remote CLI session failed with "Property crypto does not exist". Hermes has no global `crypto` binding, and `createSession` in the cloud agent SDK called `crypto.randomUUID()` directly. The package already has a runtime shim for this. The mobile app configures it with `expo-crypto` in `cloud-agent-runtime.ts`. These two call sites were the only ones that bypassed it.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryReviewed the Hermes Files Reviewed (2 files)
Reviewed by kimi-k3 · Input: 42.2K · Output: 7.5K · Cached: 446.1K Review guidance: REVIEW.md from base branch |
pandemicsyn
approved these changes
Aug 7, 2026
jeanduplessis
approved these changes
Aug 7, 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.
Problem
/newin a remote CLI session on mobile fails with "Property crypto does not exist".Hermes has no global
cryptobinding.createSessionin@kilocode/cloud-agent-sdkcalledcrypto.randomUUID()directly, so the call threw before the command reached the CLI.Fix
The package already owns a runtime shim (
packages/cloud-agent-sdk/src/runtime.ts) for exactly this. The mobile app configures it withexpo-cryptoinapps/mobile/src/lib/cloud-agent-runtime.ts.cli-live-transport.ts:879and:899were the only two call sites in the package that bypassed the shim. Both now usecloudAgentSdkRuntime.randomUUID().Test
New case in
cli-live-transport.test.tsconfigures the runtime and asserts thecreate_sessionmutationId comes from it. Verified the test fails on the old code and passes on the new code.Checks
pnpm test(cloud-agent-sdk): 107 passedpnpm typecheck(cloud-agent-sdk): cleanpnpm lint: 0 warnings, 0 errors