From 9eefbfe3103e8651807a6b008e4c27ee8c57398d Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Thu, 12 Mar 2026 01:34:16 +0900 Subject: [PATCH 1/4] fix: restore await on metadata call in create-background-task (#2441) --- src/tools/background-task/create-background-task.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/background-task/create-background-task.ts b/src/tools/background-task/create-background-task.ts index 8f57ed763..7fe155a65 100644 --- a/src/tools/background-task/create-background-task.ts +++ b/src/tools/background-task/create-background-task.ts @@ -98,7 +98,7 @@ export function createBackgroundTask( ...(sessionId ? { sessionId } : {}), }, } - ctx.metadata?.(bgMeta) + await ctx.metadata?.(bgMeta) if (ctx.callID) { storeToolMetadata(ctx.sessionID, ctx.callID, bgMeta) From 079c6b17b0d7e8580a970239e3f7c5fe5ea1fc1d Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Thu, 12 Mar 2026 01:40:24 +0900 Subject: [PATCH 2/4] fix: add FreeUsageLimitError to RETRYABLE_ERROR_NAMES set (#2393) --- src/shared/model-error-classifier.test.ts | 22 ++++++++++++++++++++++ src/shared/model-error-classifier.ts | 6 ++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/shared/model-error-classifier.test.ts b/src/shared/model-error-classifier.test.ts index d359c26d3..21e0b0f56 100644 --- a/src/shared/model-error-classifier.test.ts +++ b/src/shared/model-error-classifier.test.ts @@ -82,4 +82,26 @@ describe("model-error-classifier", () => { //#then expect(provider).toBe("provider-x") }) + + test("treats FreeUsageLimitError (lowercase) as retryable by name", () => { + //#given + const error = { name: "FreeUsageLimitError" } + + //#when + const result = shouldRetryError(error) + + //#then + expect(result).toBe(true) + }) + + test("treats freeusagelimiterror (lowercase name) as retryable by name", () => { + //#given + const error = { name: "freeusagelimiterror" } + + //#when + const result = shouldRetryError(error) + + //#then + expect(result).toBe(true) + }) }) diff --git a/src/shared/model-error-classifier.ts b/src/shared/model-error-classifier.ts index 2bb7ef176..eb8236f78 100644 --- a/src/shared/model-error-classifier.ts +++ b/src/shared/model-error-classifier.ts @@ -13,6 +13,7 @@ const RETRYABLE_ERROR_NAMES = new Set([ "ModelUnavailableError", "ProviderConnectionError", "AuthenticationError", + "freeusagelimiterror", ]) /** @@ -97,12 +98,13 @@ export interface ErrorInfo { export function isRetryableModelError(error: ErrorInfo): boolean { // If we have an error name, check against known lists if (error.name) { + const errorNameLower = error.name.toLowerCase() // Explicit non-retryable takes precedence - if (NON_RETRYABLE_ERROR_NAMES.has(error.name)) { + if (NON_RETRYABLE_ERROR_NAMES.has(errorNameLower)) { return false } // Check if it's a known retryable error - if (RETRYABLE_ERROR_NAMES.has(error.name)) { + if (RETRYABLE_ERROR_NAMES.has(errorNameLower)) { return true } } From 99730088ef575a9aa1bec29739730040e7b53b03 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Thu, 12 Mar 2026 01:51:25 +0900 Subject: [PATCH 3/4] fix: remove contaminated await change from FreeUsageLimitError PR Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- src/tools/background-task/create-background-task.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/background-task/create-background-task.ts b/src/tools/background-task/create-background-task.ts index 7fe155a65..8f57ed763 100644 --- a/src/tools/background-task/create-background-task.ts +++ b/src/tools/background-task/create-background-task.ts @@ -98,7 +98,7 @@ export function createBackgroundTask( ...(sessionId ? { sessionId } : {}), }, } - await ctx.metadata?.(bgMeta) + ctx.metadata?.(bgMeta) if (ctx.callID) { storeToolMetadata(ctx.sessionID, ctx.callID, bgMeta) From 755efe226eeb28da44952b414621d895efc5e30e Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Thu, 12 Mar 2026 11:05:26 +0900 Subject: [PATCH 4/4] fix: address Cubic findings for FreeUsageLimitError classification Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- src/shared/model-error-classifier.test.ts | 2 +- src/shared/model-error-classifier.ts | 28 +++++++++++------------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/shared/model-error-classifier.test.ts b/src/shared/model-error-classifier.test.ts index 21e0b0f56..88ba63dd5 100644 --- a/src/shared/model-error-classifier.test.ts +++ b/src/shared/model-error-classifier.test.ts @@ -83,7 +83,7 @@ describe("model-error-classifier", () => { expect(provider).toBe("provider-x") }) - test("treats FreeUsageLimitError (lowercase) as retryable by name", () => { + test("treats FreeUsageLimitError (PascalCase name) as retryable by name", () => { //#given const error = { name: "FreeUsageLimitError" } diff --git a/src/shared/model-error-classifier.ts b/src/shared/model-error-classifier.ts index eb8236f78..3c3af4982 100644 --- a/src/shared/model-error-classifier.ts +++ b/src/shared/model-error-classifier.ts @@ -6,13 +6,13 @@ import { readConnectedProvidersCache } from "./connected-providers-cache" * These errors completely halt the action loop and should trigger fallback retry. */ const RETRYABLE_ERROR_NAMES = new Set([ - "ProviderModelNotFoundError", - "RateLimitError", - "QuotaExceededError", - "InsufficientCreditsError", - "ModelUnavailableError", - "ProviderConnectionError", - "AuthenticationError", + "providermodelnotfounderror", + "ratelimiterror", + "quotaexceedederror", + "insufficientcreditserror", + "modelunavailableerror", + "providerconnectionerror", + "authenticationerror", "freeusagelimiterror", ]) @@ -21,13 +21,13 @@ const RETRYABLE_ERROR_NAMES = new Set([ * These errors are typically user-induced or fixable without switching models. */ const NON_RETRYABLE_ERROR_NAMES = new Set([ - "MessageAbortedError", - "PermissionDeniedError", - "ContextLengthError", - "TimeoutError", - "ValidationError", - "SyntaxError", - "UserError", + "messageabortederror", + "permissiondeniederror", + "contextlengtherror", + "timeouterror", + "validationerror", + "syntaxerror", + "usererror", ]) /**