Skip to content

[Feature Request] Configurable Retry Mechanism via opencode.json #3011

Closed

Description

@H0llyW00dzZ

This is a request to add a retry mechanism that can be configured through opencode.json.

For example, we should be able to define retry settings per provider—such as allowing up to 3 retries within a customizable time window (e.g., 5 seconds). This would improve reliability, especially since the current implementation lacks configurable retries.

Activity

  1. github-actions commented on Oct 7, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. H0llyW00dzZ commented on Oct 7, 2025

    @H0llyW00dzZ
    Author

    Also This retry mechanism should also handle provider-specific API errors.

  3. rekram1-node commented on Oct 7, 2025

    @rekram1-node
    Contributor

    Yeah we do already have retries setup but making it configurable makes sense. This is probably a lower priotiery currently tho

  4. H0llyW00dzZ commented on Oct 7, 2025

    @H0llyW00dzZ
    Author

    Yeah we do already have retries setup but making it configurable makes sense. This is probably a lower priotiery currently tho

    @rekram1-node, regarding the configurable retry mechanism for handling API errors, I think it would be better to use a fixed interval. For example, we could set 4 retries over 10 seconds—so each retry happens every 2.5 seconds—or simply retry every 10 seconds. This would be simpler than increasing the delay between retries (i.e., exponential backoff).

  5. kierr commented on Oct 8, 2025

    @kierr

    Yeah we do already have retries setup but making it configurable makes sense. This is probably a lower priotiery currently tho

    What's the default for retries at the moment? It might be low priority for those using stable internet, reliable providers, and perfectly compatible models... but for those who aren't so lucky... it's an easy way to recover from errors and hiccups without having to habitually say "Continue".

    Claude Code has the ENV var CLAUDE_CODE_MAX_RETRIES which I have set to 100. That works for API errors as well as API timeouts. Opencode seems to give up after a single timeout?

  6. kierr commented on Oct 8, 2025

    @kierr

    There is also this! #2116

  7. rekram1-node commented on Oct 8, 2025

    @rekram1-node
    Contributor

    yeah it looks like itd be pretty simple to add a config setting or an env var, I will take a look at pr later

  8. adamal commented on Jan 24, 2026

    @adamal

    Using OpenCode with gpt-5.2-codex from Azure, I frequently get ratelimit errors and timeouts. In Codex, setting max retries to 100 mostly solves the problem. In OpenCode, I frequently have to say "continue".
    Very annoying for unsupervised sessions.

  9. github-actions commented on Mar 27, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  10. j3k0 commented on May 17, 2026

    @j3k0

    The configurable retry mechanism is now implemented natively in #26292 — supports array in config, , per-agent overrides, and header parsing.

  11. j3k0 commented on May 17, 2026

    @j3k0

    The configurable retry mechanism is now implemented natively in #26292 — supports fallbacks array in config, cooldown_seconds, per-agent overrides, and retry-after header parsing.

  12. litoj commented on Oct 14, 2026

    @litoj

    is there a way to bind a mapping to a 'retry' action? So that when I kill the subagent elsewhere etc. that was stalling my main agent because of api parallel limits I would be able to immediately tell the main agent to continue instead of waiting the given interval?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions