From 50b34c44549707969d59ec27617b5f02295d039c Mon Sep 17 00:00:00 2001 From: Mateusz Sluszniak <56299341+msluszniak@users.noreply.github.com> Date: Tue, 3 Mar 2026 16:42:55 +0100 Subject: [PATCH 1/5] Update dependabot configuration for npm packages Consolidate npm update configuration and change schedule to monthly. --- .github/dependabot.yml | 92 ++++++------------------------------------ 1 file changed, 12 insertions(+), 80 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 29651a3c01..a06b1c5f58 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,91 +1,23 @@ version: 2 updates: - package-ecosystem: "npm" - directory: "/" + directories: + - "/" + - "/packages/*" + - "/apps/*" + - "/docs" schedule: - interval: "weekly" + interval: "monthly" groups: security-updates: applies-to: security-updates patterns: - "*" - - - package-ecosystem: "npm" - directory: "/packages/react-native-executorch" - schedule: - interval: "weekly" - groups: - security-updates: - applies-to: security-updates - patterns: - - "*" - - - package-ecosystem: "npm" - directory: "/packages/bare-resource-fetcher" - schedule: - interval: "weekly" - groups: - security-updates: - applies-to: security-updates - patterns: - - "*" - - - package-ecosystem: "npm" - directory: "/packages/expo-resource-fetcher" - schedule: - interval: "weekly" - groups: - security-updates: - applies-to: security-updates - patterns: - - "*" - - - package-ecosystem: "npm" - directory: "/apps/llm" - schedule: - interval: "weekly" - groups: - security-updates: - applies-to: security-updates - patterns: - - "*" - - - package-ecosystem: "npm" - directory: "/apps/computer-vision" - schedule: - interval: "weekly" - groups: - security-updates: - applies-to: security-updates - patterns: - - "*" - - - package-ecosystem: "npm" - directory: "/apps/speech" - schedule: - interval: "weekly" - groups: - security-updates: - applies-to: security-updates - patterns: - - "*" - - - package-ecosystem: "npm" - directory: "/apps/text-embeddings" - schedule: - interval: "weekly" - groups: - security-updates: - applies-to: security-updates - patterns: - - "*" - - - package-ecosystem: "npm" - directory: "/docs" - schedule: - interval: "weekly" - groups: - security-updates: - applies-to: security-updates + all-updates: + applies-to: version-updates patterns: - "*" + ignore: + - dependency-name: "*" + update-types: + - "version-update:semver-patch" From 10776c1f4d07a02136cc1e2aafdf56253a655072 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 7 May 2026 19:57:10 +0000 Subject: [PATCH 2/5] fix(errors): regroup error codes into unified chunks and fix out-of-range codes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - InvalidModelSource: 0xff → 0x78 (was outside the 0x60-0x7f general range) - UnexpectedNumInputs: 0x61 → 0x79 (was below the main general block start) - TokenizerError: moved from before the SpeechToText section into it (code 0xa7 is correct, position was wrong) - Added range headers (0x60-0x7f, 0xa0-0xaf, 0xb0-0xbf, 0x00-0x3f) to each section - Regenerated ErrorCodes.ts and ErrorCodes.h via codegen:errors Closes #820 https://claude.ai/code/session_01DL16DfNCQUGDvmKedjsWCZ --- .../common/rnexecutorch/ErrorCodes.h | 22 ++++----- .../src/errors/ErrorCodes.ts | 20 ++++---- scripts/errors.config.ts | 46 +++++++++++-------- 3 files changed, 48 insertions(+), 40 deletions(-) diff --git a/packages/react-native-executorch/common/rnexecutorch/ErrorCodes.h b/packages/react-native-executorch/common/rnexecutorch/ErrorCodes.h index 48a6ad3619..9cb619056e 100644 --- a/packages/react-native-executorch/common/rnexecutorch/ErrorCodes.h +++ b/packages/react-native-executorch/common/rnexecutorch/ErrorCodes.h @@ -38,15 +38,6 @@ enum class RnExecutorchErrorCode : int32_t { * when LLM's topp is outside of range [0, 1]. */ InvalidConfig = 112, - /** - * Thrown when the type of model source passed by the user is invalid. - */ - InvalidModelSource = 255, - /** - * Thrown when the number of passed inputs to the model is different than the - * model metadata specifies. - */ - UnexpectedNumInputs = 97, /** * Thrown when React Native ExecuTorch threadpool problem occurs. */ @@ -81,9 +72,14 @@ enum class RnExecutorchErrorCode : int32_t { */ PlatformNotSupported = 119, /** - * Thrown when an error occurs with the tokenizer or tokenization process. + * Thrown when the type of model source passed by the user is invalid. */ - TokenizerError = 167, + InvalidModelSource = 120, + /** + * Thrown when the number of passed inputs to the model is different than the + * model metadata specifies. + */ + UnexpectedNumInputs = 121, /** * Thrown when there's a configuration mismatch between multilingual and * language settings in Speech-to-Text models. @@ -104,6 +100,10 @@ enum class RnExecutorchErrorCode : int32_t { * already in progress. */ StreamingInProgress = 163, + /** + * Thrown when an error occurs with the tokenizer or tokenization process. + */ + TokenizerError = 167, /** * Thrown when a resource fails to download. This could be due to invalid URL, * or for example a network problem. diff --git a/packages/react-native-executorch/src/errors/ErrorCodes.ts b/packages/react-native-executorch/src/errors/ErrorCodes.ts index 6e2d8b324a..c264240486 100644 --- a/packages/react-native-executorch/src/errors/ErrorCodes.ts +++ b/packages/react-native-executorch/src/errors/ErrorCodes.ts @@ -26,14 +26,6 @@ export enum RnExecutorchErrorCode { * Thrown when config parameters passed to a model are invalid. For example, when LLM's topp is outside of range [0, 1]. */ InvalidConfig = 112, - /** - * Thrown when the type of model source passed by the user is invalid. - */ - InvalidModelSource = 255, - /** - * Thrown when the number of passed inputs to the model is different than the model metadata specifies. - */ - UnexpectedNumInputs = 97, /** * Thrown when React Native ExecuTorch threadpool problem occurs. */ @@ -63,9 +55,13 @@ export enum RnExecutorchErrorCode { */ PlatformNotSupported = 119, /** - * Thrown when an error occurs with the tokenizer or tokenization process. + * Thrown when the type of model source passed by the user is invalid. */ - TokenizerError = 167, + InvalidModelSource = 120, + /** + * Thrown when the number of passed inputs to the model is different than the model metadata specifies. + */ + UnexpectedNumInputs = 121, /** * Thrown when there's a configuration mismatch between multilingual and language settings in Speech-to-Text models. */ @@ -82,6 +78,10 @@ export enum RnExecutorchErrorCode { * Thrown when trying to start a new streaming session while another is already in progress. */ StreamingInProgress = 163, + /** + * Thrown when an error occurs with the tokenizer or tokenization process. + */ + TokenizerError = 167, /** * Thrown when a resource fails to download. This could be due to invalid URL, or for example a network problem. */ diff --git a/scripts/errors.config.ts b/scripts/errors.config.ts index 1df4fb7e47..a5a47dc168 100644 --- a/scripts/errors.config.ts +++ b/scripts/errors.config.ts @@ -2,7 +2,9 @@ // Run `yarn codegen:errors` to generate C++ and TypeScript enums export const errorDefinitions = { - // React-native-ExecuTorch errors + // ========================================================================= + // General React Native ExecuTorch errors (0x60–0x7f) + // ========================================================================= /** * An umbrella-error that is thrown usually when something unexpected happens, for example a 3rd-party library error. */ @@ -27,14 +29,6 @@ export const errorDefinitions = { * Thrown when config parameters passed to a model are invalid. For example, when LLM's topp is outside of range [0, 1]. */ InvalidConfig: 0x70, - /* - * Thrown when the type of model source passed by the user is invalid. - */ - InvalidModelSource: 0xff, - /* - * Thrown when the number of passed inputs to the model is different than the model metadata specifies. - */ - UnexpectedNumInputs: 0x61, /* * Thrown when React Native ExecuTorch threadpool problem occurs. */ @@ -63,12 +57,18 @@ export const errorDefinitions = { * Thrown when a feature or platform is not supported in the current environment. */ PlatformNotSupported: 0x77, - /* - * Thrown when an error occurs with the tokenizer or tokenization process. + * Thrown when the type of model source passed by the user is invalid. */ - TokenizerError: 0xa7, - // INFO: SpeechToText errors + InvalidModelSource: 0x78, + /* + * Thrown when the number of passed inputs to the model is different than the model metadata specifies. + */ + UnexpectedNumInputs: 0x79, + + // ========================================================================= + // Speech to Text errors (0xa0–0xaf) + // ========================================================================= /* * Thrown when there's a configuration mismatch between multilingual and language settings in Speech-to-Text models. */ @@ -85,8 +85,14 @@ export const errorDefinitions = { * Thrown when trying to start a new streaming session while another is already in progress. */ StreamingInProgress: 0xa3, + /* + * Thrown when an error occurs with the tokenizer or tokenization process. + */ + TokenizerError: 0xa7, - // INFO: Resource Fetcher Errors + // ========================================================================= + // Resource Fetcher errors (0xb0–0xbf) + // ========================================================================= /** * Thrown when a resource fails to download. This could be due to invalid URL, or for example a network problem. */ @@ -120,10 +126,12 @@ export const errorDefinitions = { */ ResourceFetcherPlatformNotSupported: 0xbb, - // ExecuTorch mapped errors + // ========================================================================= + // ExecuTorch mapped errors (0x00–0x3f) // Based on: https://github.com/pytorch/executorch/blob/main/runtime/core/error.h + // ========================================================================= - // System errors + // System errors (0x00–0x0f) /** * Status indicating a successful operation. */ @@ -141,7 +149,7 @@ export const errorDefinitions = { */ EndOfMethod: 0x03, - // Logical errors + // Logical errors (0x10–0x1f) /** * Operation is not supported in the current context. */ @@ -163,7 +171,7 @@ export const errorDefinitions = { */ OperatorMissing: 0x14, - // Resource errors + // Resource errors (0x20–0x2f) /** * Requested resource could not be found. */ @@ -189,7 +197,7 @@ export const errorDefinitions = { */ OutOfResources: 0x25, - // Delegate errors + // Delegate errors (0x30–0x3f) /** * Init stage: Backend receives an incompatible delegate version. */ From 93da624ceb30ca25416fdb64de964d69d98de999 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 7 May 2026 20:02:51 +0000 Subject: [PATCH 3/5] fix(errors): move TokenizerError to general RNE group (0x7a) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TokenizerError is not exclusive to Speech-to-Text — tokenizers are used across LLMs, embeddings, and other models. Reassign from 0xa7 to 0x7a and move it into the general RNE errors section (0x60-0x7f). https://claude.ai/code/session_01DL16DfNCQUGDvmKedjsWCZ --- .../common/rnexecutorch/ErrorCodes.h | 8 ++++---- packages/react-native-executorch/src/errors/ErrorCodes.ts | 8 ++++---- scripts/errors.config.ts | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/react-native-executorch/common/rnexecutorch/ErrorCodes.h b/packages/react-native-executorch/common/rnexecutorch/ErrorCodes.h index 9cb619056e..eed3fef96c 100644 --- a/packages/react-native-executorch/common/rnexecutorch/ErrorCodes.h +++ b/packages/react-native-executorch/common/rnexecutorch/ErrorCodes.h @@ -80,6 +80,10 @@ enum class RnExecutorchErrorCode : int32_t { * model metadata specifies. */ UnexpectedNumInputs = 121, + /** + * Thrown when an error occurs with the tokenizer or tokenization process. + */ + TokenizerError = 122, /** * Thrown when there's a configuration mismatch between multilingual and * language settings in Speech-to-Text models. @@ -100,10 +104,6 @@ enum class RnExecutorchErrorCode : int32_t { * already in progress. */ StreamingInProgress = 163, - /** - * Thrown when an error occurs with the tokenizer or tokenization process. - */ - TokenizerError = 167, /** * Thrown when a resource fails to download. This could be due to invalid URL, * or for example a network problem. diff --git a/packages/react-native-executorch/src/errors/ErrorCodes.ts b/packages/react-native-executorch/src/errors/ErrorCodes.ts index c264240486..8486aa9418 100644 --- a/packages/react-native-executorch/src/errors/ErrorCodes.ts +++ b/packages/react-native-executorch/src/errors/ErrorCodes.ts @@ -62,6 +62,10 @@ export enum RnExecutorchErrorCode { * Thrown when the number of passed inputs to the model is different than the model metadata specifies. */ UnexpectedNumInputs = 121, + /** + * Thrown when an error occurs with the tokenizer or tokenization process. + */ + TokenizerError = 122, /** * Thrown when there's a configuration mismatch between multilingual and language settings in Speech-to-Text models. */ @@ -78,10 +82,6 @@ export enum RnExecutorchErrorCode { * Thrown when trying to start a new streaming session while another is already in progress. */ StreamingInProgress = 163, - /** - * Thrown when an error occurs with the tokenizer or tokenization process. - */ - TokenizerError = 167, /** * Thrown when a resource fails to download. This could be due to invalid URL, or for example a network problem. */ diff --git a/scripts/errors.config.ts b/scripts/errors.config.ts index a5a47dc168..f18949ff09 100644 --- a/scripts/errors.config.ts +++ b/scripts/errors.config.ts @@ -65,6 +65,10 @@ export const errorDefinitions = { * Thrown when the number of passed inputs to the model is different than the model metadata specifies. */ UnexpectedNumInputs: 0x79, + /* + * Thrown when an error occurs with the tokenizer or tokenization process. + */ + TokenizerError: 0x7a, // ========================================================================= // Speech to Text errors (0xa0–0xaf) @@ -85,10 +89,6 @@ export const errorDefinitions = { * Thrown when trying to start a new streaming session while another is already in progress. */ StreamingInProgress: 0xa3, - /* - * Thrown when an error occurs with the tokenizer or tokenization process. - */ - TokenizerError: 0xa7, // ========================================================================= // Resource Fetcher errors (0xb0–0xbf) From cad66440b4f31cc76c069d65ad497945c3dbb1e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20S=C5=82uszniak?= Date: Tue, 12 May 2026 14:10:15 +0200 Subject: [PATCH 4/5] fix(errors): add missing AlreadyLoaded ExecuTorch error code (0x04) Added in ExecuTorch v1.2.0. Also exclude it from the C++ enum filter so the generator does not emit it on the native side. --- packages/react-native-executorch/src/errors/ErrorCodes.ts | 4 ++++ scripts/errors.config.ts | 4 ++++ scripts/generate-errors.ts | 1 + 3 files changed, 9 insertions(+) diff --git a/packages/react-native-executorch/src/errors/ErrorCodes.ts b/packages/react-native-executorch/src/errors/ErrorCodes.ts index 8486aa9418..0b124975ad 100644 --- a/packages/react-native-executorch/src/errors/ErrorCodes.ts +++ b/packages/react-native-executorch/src/errors/ErrorCodes.ts @@ -130,6 +130,10 @@ export enum RnExecutorchErrorCode { * Status indicating there are no more steps of execution to run */ EndOfMethod = 3, + /** + * Status indicating a resource has already been loaded. + */ + AlreadyLoaded = 4, /** * Operation is not supported in the current context. */ diff --git a/scripts/errors.config.ts b/scripts/errors.config.ts index f18949ff09..993c2d41da 100644 --- a/scripts/errors.config.ts +++ b/scripts/errors.config.ts @@ -148,6 +148,10 @@ export const errorDefinitions = { * Status indicating there are no more steps of execution to run */ EndOfMethod: 0x03, + /** + * Status indicating a resource has already been loaded. + */ + AlreadyLoaded: 0x04, // Logical errors (0x10–0x1f) /** diff --git a/scripts/generate-errors.ts b/scripts/generate-errors.ts index 37c9abbb8b..b12b658343 100755 --- a/scripts/generate-errors.ts +++ b/scripts/generate-errors.ts @@ -37,6 +37,7 @@ function generateCppEnum() { 'Internal', 'InvalidState', 'EndOfMethod', + 'AlreadyLoaded', 'NotSupported', 'NotImplemented', 'InvalidArgument', From d27c18fd7c12b92767796efe7efd4d4bb1a0cd24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20S=C5=82uszniak?= Date: Tue, 12 May 2026 14:30:46 +0200 Subject: [PATCH 5/5] docs(errors): document AlreadyLoaded in error-handling reference --- docs/docs/05-utilities/04-error-handling.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/docs/05-utilities/04-error-handling.md b/docs/docs/05-utilities/04-error-handling.md index 8f9ee57ad0..d295fbe945 100644 --- a/docs/docs/05-utilities/04-error-handling.md +++ b/docs/docs/05-utilities/04-error-handling.md @@ -146,12 +146,13 @@ These errors are mapped directly from the ExecuTorch runtime. They typically ind #### System Errors -| Error Code | Description | -| -------------- | ----------------------------------- | -| `Ok` | Operation successful (not an error) | -| `Internal` | Internal ExecuTorch error | -| `InvalidState` | Operation called in invalid state | -| `EndOfMethod` | End of method reached | +| Error Code | Description | +| --------------- | ----------------------------------- | +| `Ok` | Operation successful (not an error) | +| `Internal` | Internal ExecuTorch error | +| `InvalidState` | Operation called in invalid state | +| `EndOfMethod` | End of method reached | +| `AlreadyLoaded` | Resource has already been loaded | #### Logical Errors