mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 04:59:37 +08:00
`crypto.getRandomValues` is not gated on a secure context — only `randomUUID` is — so it is the right fallback on a plain-HTTP deployment, and the `Math.random` tail is left only for a runtime with no Web Crypto. The bare `globalThis.crypto.randomUUID()` this fixes had a twin at `contracts/parse/turn-command.ts`, which throws in exactly the same deployment. Both now call one exported `newCommandId`, living beside the `command_id` field it fills rather than in the transport that happened to notice first. (cherry picked from commit 70333c900034d383500ca92e294b23445394068f)