Description
SessionRetry.delay accepts negative values for retry-after and retry-after-ms.
For example, retry-after-ms: -1 returns -1.
Eventually, negative value then sadly reaches retry scheduling, instead of falling back to normal exponential backoff.
This is because if (retry-after) and if (retry-after-ms), are both nullable conditions for 0 only. Not negatives.
Expected
I will force negative retry values to use normal backoff instead.
Plugins
none
OpenCode version
1.18.15
Steps to reproduce
- Call
SessionRetry.delay(1, apiError({ "retry-after-ms": "-1" })).
- Observe result is
-1.
- Repeat with
retry-after: "-1"; result is -1000.
Screenshot and/or share link
Operating System
macOS 26.2, arm64
Terminal
Ghostty
Description
SessionRetry.delayaccepts negative values forretry-afterandretry-after-ms.Eventually, negative value then sadly reaches retry scheduling, instead of falling back to normal exponential backoff.
This is because if (retry-after) and if (retry-after-ms), are both nullable conditions for
0only. Not negatives.Expected
I will force negative retry values to use normal backoff instead.
Plugins
none
OpenCode version
1.18.15
Steps to reproduce
SessionRetry.delay(1, apiError({ "retry-after-ms": "-1" })).-1.retry-after: "-1"; result is-1000.Screenshot and/or share link
Operating System
macOS 26.2, arm64
Terminal
Ghostty