Skip to content

fix: add FreeUsageLimitError to RETRYABLE_ERROR_NAMES set#2484

Merged
code-yeongyu merged 4 commits intodevfrom
fix/issue-2393-cubic-error-name
Mar 12, 2026
Merged

fix: add FreeUsageLimitError to RETRYABLE_ERROR_NAMES set#2484
code-yeongyu merged 4 commits intodevfrom
fix/issue-2393-cubic-error-name

Conversation

@code-yeongyu
Copy link
Owner

@code-yeongyu code-yeongyu commented Mar 11, 2026

Follow-up to #2422. Adds FreeUsageLimitError to structured error name set as identified by cubic code reviewer — aligns with OpenCode SDK error classification model.


Summary by cubic

Treats FreeUsageLimitError as retryable and makes error name checks case-insensitive, resolving Linear issue 2393 (Cubic error name not retried).

  • Bug Fixes
    • Normalize error names to lowercase for both retryable and non-retryable checks, add "freeusagelimiterror" to the retryable set, and add tests for PascalCase/lowercase variants.

Written for commit 755efe2. Summary will update on new commits.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 3 files

Confidence score: 2/5

  • High risk: src/shared/model-error-classifier.ts lowercases error names while lookup sets use PascalCase, which will break classification for most errors.
  • src/tools/background-task/create-background-task.ts awaits metadata() even though the SDK defines it as void, which could cause unexpected runtime behavior.
  • Pay close attention to src/shared/model-error-classifier.ts and src/tools/background-task/create-background-task.ts - error classification logic and improper async usage.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/tools/background-task/create-background-task.ts">

<violation number="1" location="src/tools/background-task/create-background-task.ts:101">
P1: Custom agent: **Opencode Compatibility**

The `metadata` method in the OpenCode SDK is typed as returning `void` and should not be awaited. It is designed to be a fire-and-forget update.</violation>
</file>

<file name="src/shared/model-error-classifier.ts">

<violation number="1" location="src/shared/model-error-classifier.ts:101">
P0: Converting the error name to lowercase breaks lookups because the sets contain PascalCase strings. This will break error classification for all other errors.</violation>
</file>

<file name="src/shared/model-error-classifier.test.ts">

<violation number="1" location="src/shared/model-error-classifier.test.ts:86">
P3: The test description incorrectly labels `FreeUsageLimitError` as lowercase.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

code-yeongyu and others added 2 commits March 12, 2026 01:51
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@code-yeongyu
Copy link
Owner Author

[sisyphus-bot] Addressed the findings identified by cubic. Summary: (1) made error-name set matching consistent with case-insensitive lookup, (2) kept the contaminated await change removed, (3) fixed the misleading PascalCase test label. @cubic-dev-ai please re-review.

@cubic-dev-ai
Copy link

cubic-dev-ai bot commented Mar 12, 2026

[sisyphus-bot] Addressed the findings identified by cubic. Summary: (1) made error-name set matching consistent with case-insensitive lookup, (2) kept the contaminated await change removed, (3) fixed the misleading PascalCase test label. @cubic-dev-ai please re-review.

@code-yeongyu I have started the AI code review. It will take a few minutes to complete.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Correctly implements case-insensitive error matching and adds FreeUsageLimitError to the retryable set with corresponding tests, ensuring no regressions.

@code-yeongyu code-yeongyu merged commit 60e6f6d into dev Mar 12, 2026
8 checks passed
@code-yeongyu code-yeongyu deleted the fix/issue-2393-cubic-error-name branch March 12, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant